In Java 8, You can directly use this filter method and then do that.
List lines = Arrays.asList("java", "pramod", "example");
List result = lines.stream()
.filter(line -> !"pramod".equals(line))
.collect(Collectors.toList());
result.forEach(System.out::println);