Utils { static <T> T requireNonNull(T obj) { if (obj == null) throw new NullPointerException(); return obj; }    }
@Test(expected = NullPointerException.class) public void requireNonNull_throwsOnNull() { Utils.requireNonNull(null); }
@Test public void requireNonNull_doesNotThrowOnNonNull() { Utils.requireNonNull("test"); }
@Test public void requireNonNull_returnsArg() { final SimpleClass expected = new SimpleClass(); final SimpleClass actual = Utils.requireNonNull(expected); Assert.assertSame(expected, actual); }