[java] In Java, remove empty elements from a list of Strings

lukastymo's answer seems the best one.

But it may be worth mentioning this approach as well for it's extensibility:

List<String> list = new ArrayList<String>(Arrays.asList("", "Hi", null, "How", "are"));

list = list.stream()
           .filter(item -> item != null && !item.isEmpty())
           .collect(Collectors.toList());

System.out.println(list);

What I mean by that is you could then add additional filters, such as:

          .filter(item -> !item.startsWith("a"))

... although of course that's not specifically relevant to the question.