Google GuavaライブラリのPreconditionsクラスのメソッド達が便利です。 http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/base/Preconditions.html nullチェック 例えば、こんな感じでメソッドの先頭でパラメータの値がnullかどうかをチェックしたい事はよくあると思います。 public void doSomething(String message) { if(message == null) { throw new NullPointerException("message must not be null."); } this.message = message; }