I am trying to create a new array in this way:
final boolean[] arr = new boolean[list.size()];
This line is throwing a null pointer in my code in some cases. Under what situations can this happen? Can it happen when the list has zero elements? I am sure the list is not null at this stage.