import org.jetbrains.annotations.NotNull; class Example { interface Listener { void notify(@NotNull String value); } public static void main(String[] args) { Listener l = value -> { if (value != null) { System.out.println(value); } }; } }