@Test public void get_throwsNullPointerException_whenNull() { thrown.expect(NullPointerException.class); Preconditions.get(null); }
@NonNull public static <T> T get(@Nullable final T reference) { if (reference == null) { throw new NullPointerException("Assertion for a nonnull object failed."); } return reference; }
Preconditions { @NonNull public static <T> T get(@Nullable final T reference) { if (reference == null) { throw new NullPointerException("Assertion for a nonnull object failed."); } return reference; } }
Preconditions { @NonNull public static <T> T get(@Nullable final T reference) { if (reference == null) { throw new NullPointerException("Assertion for a nonnull object failed."); } return reference; } private  Preconditions(); }
Preconditions { @NonNull public static <T> T get(@Nullable final T reference) { if (reference == null) { throw new NullPointerException("Assertion for a nonnull object failed."); } return reference; } private  Preconditions(); @NonNull static T get(@Nullable final T reference); static T checkNotNull(final T reference); static T checkNotNull(final T reference, @NonNull final String errorMessage); static void checkArgument(boolean expression, @NonNull final String errorMessage); }
Preconditions { @NonNull public static <T> T get(@Nullable final T reference) { if (reference == null) { throw new NullPointerException("Assertion for a nonnull object failed."); } return reference; } private  Preconditions(); @NonNull static T get(@Nullable final T reference); static T checkNotNull(final T reference); static T checkNotNull(final T reference, @NonNull final String errorMessage); static void checkArgument(boolean expression, @NonNull final String errorMessage);  }