/** * @param <T> The type * @return An immutable collection */ public static <T> Collector<T, Collection<T>, Collection<T>> toImmutableCollection() { return toImmutableCollection(ArrayList::new); } }
.find(request) .filter((match) -> match.test(request)) .collect(StreamUtils.minAll( Comparator.comparingInt((match) -> match.getVariableValues().size()), Collectors.toList()));
beans = beans.stream().sorted(OrderUtil.COMPARATOR).collect(StreamUtils.toImmutableCollection()); } else { beans = Collections.unmodifiableCollection(beans);
beans = beans.stream().sorted(OrderUtil.COMPARATOR).collect(StreamUtils.toImmutableCollection()); } else { beans = Collections.unmodifiableCollection(beans);