I try with a loop like that
// ArrayList tourists for (Tourist t : tourists) { if (t != null) { t.setId(idForm); } }
Not efficient, but short
while(tourists.remove(null));