private static Annotation translateAnnotationDefaults(DirectClassFile cf) {
    CstType thisClass = cf.getThisClass();
    MethodList methods = cf.getMethods();
    int sz = methods.size();
    Annotation result = new Annotation(thisClass, AnnotationVisibility.EMBEDDED);
    boolean any = false;

    for (int i = 0; i < sz; i++) {
      Method one = methods.get(i);
      AttributeList attribs = one.getAttributes();
      AttAnnotationDefault oneDefault =
          (AttAnnotationDefault) attribs.findFirst(AttAnnotationDefault.ATTRIBUTE_NAME);

      if (oneDefault != null) {
        NameValuePair pair = new NameValuePair(one.getNat().getName(), oneDefault.getValue());
        result.add(pair);
        any = true;
      }
    }

    if (!any) {
      return null;
    }

    result.setImmutable();
    return AnnotationUtils.makeAnnotationDefault(result);
  }
Gets the {@code AnnotationDefault} attributes out of a given class, if any, reforming them as
an {@code AnnotationDefault} annotation.

@param cf {@code non-null;} the class in question
@return {@code null-ok;} an appropriately-constructed {@code AnnotationDefault} annotation, if
    there were any annotation defaults in the class, or {@code null} if not
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/cf/AttributeTranslator.java