@Test public void testCheckNotNull() { try { Object obj = null; Preconditions.checkNotNull(obj, "Argument was %s but expected not null", obj); } catch (Exception e) { } try { Object obj = null; Preconditions.checkNotNull(obj); } catch (Exception e) { } try { Object obj = null; Preconditions.checkNotNull(obj, "Argument expected not null"); } catch (Exception e) { } }
public static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; }
Preconditions { public static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; } }
Preconditions { public static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; } private  Preconditions(); }
Preconditions { public static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; } private  Preconditions(); static void checkArgument(boolean expression); static void checkArgument(boolean expression, Object errorMessage); static void checkArgument(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static void checkState(boolean expression); static void checkState(boolean expression, Object errorMessage); static void checkState(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkNotNull(T reference); static T checkNotNull(T reference, Object errorMessage); static T checkNotNull(T reference, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkDeserializeNotNull(T reference); }
Preconditions { public static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; } private  Preconditions(); static void checkArgument(boolean expression); static void checkArgument(boolean expression, Object errorMessage); static void checkArgument(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static void checkState(boolean expression); static void checkState(boolean expression, Object errorMessage); static void checkState(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkNotNull(T reference); static T checkNotNull(T reference, Object errorMessage); static T checkNotNull(T reference, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkDeserializeNotNull(T reference);  }