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);
      }
    }
  }
}

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 ) ; } } } }
traverses down the children tree of this parent and collect all child anon . classes
