Prevent NPE from Java 8 lambdas