public void myMethod(Object aValue) throws NullPointerException { if (aValue == null){ throw new NullPointerException(); } return; }