import
import java.util.stream.Collectors;
import java.util.stream.Stream;
String to List(Integer)
String linkedNo = "123, 123, 456, 432, 567, 123";
List<Integer> list = Stream.of(linkedNo.split(","))
.map(String::trim)
.map(Integer::parseInt)
.collect(Collectors.toList());
String to List(String)
String linkedNo = "123, 123, 456, 432, 567, 123";
List<String> list = Stream.of(linkedNo.split(","))
.map(String::trim)
.collect(Collectors.toList());
중복 제거
list = list.stream().distinct().collect(Collectors.toList());
String to List(Integer) + 중복 제거
String linkedNo = "123, 123, 456, 432, 567, 123";
return Stream.of(linkedNo.split(","))
.map(String::trim)
.map(Integer::parseInt)
.distinct()
.collect(Collectors.toList());