Annotation { public boolean isNonnegative() { return NONNEGATIVE.equals(this); } Annotation(final Type annotationType); static Annotation of(@Nonnull final Class<?> annotationType); static Annotation of(@Nonnull final java.lang.annotation.Annotation annotation); static Annotation of(@Nonnull final String annotationType); @Override boolean equals(final Object obj); Type getType(); @Override int hashCode(); boolean isImmutable(); boolean isNonnegative(); boolean isNonnull(); boolean isNotThreadSafe(); boolean isNullable(); @Override String toString(); static final Annotation IMMUTABLE; static final Annotation NONNEGATIVE; static final Annotation NONNULL; static final Annotation NOT_THREAD_SAFE; static final Annotation NULLABLE; }
@Test public void isNonnegative() { assertTrue(Annotation.of(Nonnegative.class).isNonnegative()); assertFalse(Annotation.of(Nonnull.class).isNonnegative()); }