docs: private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException {
          IJavaElement[] children = parent.getChildren();
          for (int i = 0; i < children.length; i++) {
              IJavaElement childElem = children[i];
              if (isAnonymousType(childElem)) {
                  list.add((IType) childElem);
              }
              if (childElem instanceof IParent) {
                  if (allowNested || !(childElem instanceof IType)) {
                      collectAllAnonymous(list, (IParent) childElem, allowNested);
                  }
              }
          }
      }