News for hackers. Stuff that matters.
Re:Love It or Hate It, Java Continues to Evolve by ngrilly on Monday June 17, 2019 @05:55AM (#20201367)
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*/
    }
  }

There are no comments on this comment yet.