@Test(expected = IllegalArgumentException.class) public void testHandlingOfNullElementArgumentForLookup() { this.testee.get(null); }
@SuppressWarnings("unchecked") public <T extends Annotation> T get(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } return (T) getAnnotationMap().get(type); }
Annotations implements Iterable<Annotation> { @SuppressWarnings("unchecked") public <T extends Annotation> T get(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } return (T) getAnnotationMap().get(type); } }
Annotations implements Iterable<Annotation> { @SuppressWarnings("unchecked") public <T extends Annotation> T get(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } return (T) getAnnotationMap().get(type); } Annotations(AnnotatedElement annotatedElement); }
Annotations implements Iterable<Annotation> { @SuppressWarnings("unchecked") public <T extends Annotation> T get(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } return (T) getAnnotationMap().get(type); } Annotations(AnnotatedElement annotatedElement); static Annotations annotations(AnnotatedElement annotatedElement); boolean contains(Class<? extends Annotation> type); boolean containsName(String name); @SuppressWarnings("unchecked") T get(Class<T> type); Stream<Annotation> stream(); @Override @Nonnull Iterator<Annotation> iterator(); Map<Class<? extends Annotation>, Annotation> getAnnotations(); }
Annotations implements Iterable<Annotation> { @SuppressWarnings("unchecked") public <T extends Annotation> T get(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } return (T) getAnnotationMap().get(type); } Annotations(AnnotatedElement annotatedElement); static Annotations annotations(AnnotatedElement annotatedElement); boolean contains(Class<? extends Annotation> type); boolean containsName(String name); @SuppressWarnings("unchecked") T get(Class<T> type); Stream<Annotation> stream(); @Override @Nonnull Iterator<Annotation> iterator(); Map<Class<? extends Annotation>, Annotation> getAnnotations();  }