Java 8 스트림을 Guava ImmutableCollection으로 수집하려면 어떻게해야합니까?
Java 8 스트림을 Guava ImmutableCollection으로 수집하려면 어떻게해야합니까? 다음을 수행하고 싶습니다. List list = IntStream.range(0, 7).collect(Collectors.toList()); 그러나 결과 목록은 Guava의 ImmutableList. 내가 할 수 있다는 걸 알아 List list = IntStream.range(0, 7).collect(Collectors.toList()); List immutableList = ImmutableList.copyOf(list); 하지만 직접 수집하고 싶습니다. 난 노력 했어 List list = IntStream.range(0, 7) .collect(Collectors.toCollection(Immutabl..