Java tutorial
import java.util.Arrays; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; public class Main { public static void main(String[] argv) throws Exception { List<String> argList = Arrays.asList("help", "v"); Predicate<String> isHelp = (s) -> s.matches("(h|help)"); argList = argList.stream().filter(isHelp.negate()).collect(Collectors.toList()); System.out.println(argList); } }