I am preparing for an OCPJP 8 exam for the next 2 months and currently I this one got my attention as I dont understand why
public class BiPredicateTest {
java.util.Arrays.asList() produces a list from which it is impossible to remove elements, so it throws on a removal attempt.
You could wrap it with ArrayList:
List<Integer> ints = new java.util.ArrayList<>(java.util.Arrays.asList(1,20,20));
Arrays.asList() returns return new ArrayList<>(a); where ArrayList is not java.util.ArrayList, but java.util.Arrays.ArrayList (internal class), which does not allow removal.