I have a 2d array
ArrayList<List<Customer>> list;
Each customerNode stores two customers. I want to add a new list of customers to the list array if neither of the customers exist in any of the current List<Customer> in list. However, when I run this it doesnt add the 'newR' to the list.
for(customerNode s: customers){
count++;
if(!LinearSearch2(s.getOne(), s.getTwo())){
System.out.println("Test");
ArrayList<Customer> newR = new ArrayList<Customer>();
newR.add(s.getOne());
newR.add(s.getTwo());
list.add(newR);
}
}
thanks in advance!