code: @Nullable
    private static <A extends Annotation> A getAnnotation(PropertyDescriptor descriptor,
        Class<A> type) {
      A a = null;
      if (descriptor.getWriteMethod() != null) {
        a = descriptor.getWriteMethod().getAnnotation(type);
      }
      if (a == null && descriptor.getReadMethod() != null) {
        a = descriptor.getReadMethod().getAnnotation(type);
      }
      return a;
    }
docs: Get annotation from either writer or reader of a Java property
  
  @param <A> Type of annotation
  @param descriptor Field descriptor from which annotation is searched
  @param type Type of annotation
  @return Annotation or null if it's not found