private static <T extends IElement> void addElement(ArrayList<T> retVal, IElement next, Class<T> theType) {
		//FIXME There seems to be an error on theType == null => if (theType != null|| theType.isAssignableFrom
		if (theType == null|| theType.isAssignableFrom(next.getClass())) {
			retVal.add(theType.cast(next));
		}
		if (next instanceof ICompositeElement) {
			ICompositeElement iCompositeElement = (ICompositeElement) next;
			//TODO: Use of a deprecated method should be resolved.
			retVal.addAll(iCompositeElement.getAllPopulatedChildElementsOfType(theType));
		}
	}
private static < T extends IElement > void addElement ( ArrayList < T > retVal , IElement next , Class < T > theType ) { if ( theType == null || theType . isAssignableFrom ( next . getClass ( ) ) ) { retVal . add ( theType . cast ( next ) ) ; } if ( next instanceof ICompositeElement ) { ICompositeElement iCompositeElement = ( ICompositeElement ) next ; retVal . addAll ( iCompositeElement . getAllPopulatedChildElementsOfType ( theType ) ) ; } }
@SuppressWarnings("unchecked")