private static Map<String, Class<?>> discoverInnerClassesMap(Class<?> cls) {
        Map<String, Class<?>> classes = new HashMap<>();
        
        for (Class<?> innerClass : cls.getClasses()) {
            if (Modifier.isStatic(innerClass.getModifiers())) {
                String name = innerClass.getSimpleName();
                Class<?> oldInnerClass = classes.get(name);
                if (oldInnerClass == null || isInnerClassHiding(innerClass, oldInnerClass)) {
                    classes.put(name, innerClass);
                }
            }
        }
        
        return classes;
    }