code: public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) {
          return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
      }
docs: Gets annotation.
  
  @param annotations     the annotations
  @param annotationClass the annotation class
  @return the annotation