* @return list of extensibility elements of the given type
*/
@SuppressWarnings("unchecked")
private <T extends ExtensibilityElement> List<T> getElementsForType(final QName type, Class<T> cls) {
List<T> ret = new ArrayList<T>();
CollectionsX.filter(ret, getExtensibilityElements(), new MemberOfFunction() {
public boolean isMember(Object o) {
return ((ExtensibilityElement)o).getElementType().equals(type);
}
});
return ret;