/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		List<Integer> integers = Arrays.asList(4, 5, 7, 3, 5, 4, 2, 4);
		Map<Integer, Long> grouping = integers.stream()
		        .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
		grouping.values().removeIf(c -> c > 1);
		System.out.println(grouping.keySet());
	}
}