2 ms·
Thanks! I guess your example could be simplified further with the var keyword: public static void assertIsSuperset(Collection<Object> superSet, Collection<Ob
by ngrilly 7y ago
Thanks! I guess your example could be simplified further with the var keyword:
public static void assertIsSuperset(Collection<Object> superSet, Collection<Object> actualSet) {
var missing = actualSet.stream().filter(x -> !superSet.contains(x)).collect(Collectors.toList());
if (missing.size() != 0) {
/* Imagine some more verbose exception creation here, which is why we caught it in a list*/
}
}