code: public TypeElement findParent(TypeElement typeElement, Set<TypeElement> parents) {
      TypeMirror type;
      while (true) {
        type = typeElement.getSuperclass();
        if (type.getKind() == TypeKind.NONE) {
          return null;
        }
        typeElement = (TypeElement) ((DeclaredType) type).asElement();
        if (containsTypeMirror(parents, type)) {
          return typeElement;
        }
      }
    }
docs: Finds the parent binder type in the supplied set, if any.