class Foo { private void someMethod(String someArg) { someArg.getClass(); if (someArg == null) { System.err.println("Wrong argument"); } } }