brianwernick
01/03/2017, 5:40 PMx a variable in the same encapsulation or is it a class variable? If x has the possibility to change between the x != null and x.isEmpty() check then you can get the NPE. You should be able to do x.orEmpty().isEmpty() instead