CheckResult { public static CheckResult valueOf(String message) { if (message == null) { throw new NullPointerException("message"); } return new CheckResult(message); } private  CheckResult(String message); static CheckResult valueOf(String message); boolean isError(); String getMessage(); static final CheckResult OK; }
@Test(expected=NullPointerException.class) public void testNullMessage() { CheckResult.valueOf(null); }