I try with a loop like that
// ArrayList tourists for (Tourist t : tourists) { if (t != null) { t.setId(idForm); } }
Try:
tourists.removeAll(Collections.singleton(null));
Read the Java API. The code will throw java.lang.UnsupportedOperationException for immutable lists (such as created with Arrays.asList); see this answer for more details.
java.lang.UnsupportedOperationException
Arrays.asList