class InheritanceAnalyser implements ClassAnalyser<Map<String, Class<?>[]>> {

    @Override
    public Map<String, Class<?>[]> analyse(Map<String, Class<?>> classes) {
        Map<String, Class<?>[]> inheritances = new TreeMap<String, Class<?>[]>();
        List<Class<?>> classList = new ArrayList<Class<?>>();
        String[] classNames = classes.keySet().toArray(EMPTY_STRING_ARRAY);
        Class<?> type;
        
        for (Map.Entry<String, Class<?>> entry : classes.entrySet()) {
            classList.clear();
            LOGGER.debug("analyse - looking for {}", entry.getKey());
            for (String className : classNames) {
                if (!entry.getKey().equals(className)) {
                    type = classes.get(className);
                    if (entry.getValue().isAssignableFrom(type) && !type.isInterface() && !Modifier.isAbstract(type.getModifiers())) {
                        classList.add(type);
                        LOGGER.debug("analyse - found {}", type);
                    }
                }
            }
            if (!classList.isEmpty()) {
                inheritances.put(entry.getKey(), classList.toArray(EMPTY_CLASS_ARRAY));
            }
        }
        
        return inheritances;
    }

}