/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.util.stream.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { { int[] array = {1,2,3,4}; final List<Integer> list = Arrays.stream(array).boxed().filter(i->i!=3).collect(Collectors.toList()); } }