ArrayList result = new ArrayList();
HashSet result = new HashSet();
    public static Class[] getAllInterfaces(Class clazz) {    	ArrayList result = new ArrayList();                do {            Class[] interfaces = clazz.getInterfaces();            for (int i = 0; i < interfaces.length; i++) {				result.add(interfaces[i]);			}            clazz = clazz.getSuperclass();        } while(clazz.getSuperclass() != null);                return (Class[])result.toArray(new Class[result.size()]);    }