void (@Nullable String text) { if (Objects.toString(text).isEmpty()) { System.out.println("Is Empty"); } else { // In this case system can produce NullPointerException, because Objects.toString(String str) calls methods String.valueOf() System.out.println(text.<warning descr="Method invocation 'trim' may produce 'NullPointerException'">trim</warning>()); } }