Trying to create filter, need to choose records which type is not equals "N". I trying do it by this way, but I getting NullPointer. I think this is because in my database Type
sometimes is null. How can I fix this filter to not get NullPointer?
Collection<Plan> plan = packet.getPlan().stream() //
.filter(item -> !item.getType().equals("N")) //
.map(packetPlan -> Plan.newInstance( //
packetPlan, //
activePlan.contains(packetPlan.getType()))) //
.collect(Collectors.toList());