Stream과 Distinct를 활용한 중복제거
** List<Object>일 경우에는 Object의 hash가 다를 수 있으므로 distinct 하여도 중복된 값이 걸러지지 않을 수 있음.
private void checkDuplicated(List<Integer> list) {
list = list.stream().distinct.sorted.collect(Collectors.toList());
list.forEach(i -> System.out.print(i));
}
Map 내 Key, Value 체크가 필요할때
private void printKeyValue(Map<String, Object> map) {
map.forEach((key, value) -> System.out.println(key + " : " + value + "\n"));
}