Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // ArrayList tourists
  2.  
  3. for (Tourist t : tourists) {
  4. if (t != null) {
  5. t.setId(idForm);
  6. }
  7. }
  8.  
  9. tourists.removeAll(Collections.singleton(null));
  10.  
  11. list.removeAll(Collections.singleton(null));
  12.  
  13. public static String[] clean(final String[] v) {
  14. List<String> list = new ArrayList<String>(Arrays.asList(v));
  15. list.removeAll(Collections.singleton(null));
  16. return list.toArray(new String[list.size()]);
  17. }
  18.  
  19. while(tourists.remove(null));
  20.  
  21. for (Iterator<Tourist> itr = tourists.iterator(); itr.hasNext();) {
  22. if (itr.next() == null) { itr.remove(); }
  23. }
  24.  
  25. ImmutableList.copyOf(Iterables.filter(tourists, Predicates.notNull()))
  26.  
  27. List s1=new ArrayList();
  28. s1.add(null);
  29.  
  30. yourCollection.removeAll(s1);
  31.  
  32. tourists.removeAll(Arrays.asList(null));
  33.  
  34. tourists.removeAll(Arrays.asList("null"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement