I basically would like to do something like:
assertEquals(Arrays.asList(1,2,3).stream() .noDiscardingFilter(x -> x!=1
If you want to only change the entries which match the filter but retain the rest.
assertEquals(Arrays.asList(-1, 1, 20, 30), Stream.of(-1, 1, 2, 3) .map(i -> i <= 1 ? i /* retain */ : 10 * i /* transform */) .collect(Collectors.toList()));