class ClassLoaderClassInformationRepository implements ClassInformationRepository {

    @Override
    public ClassInformation getInformation(String internalClassName) {
        Validate.notNull(internalClassName);
        
        String className = Type.getObjectType(internalClassName).getClassName();
        Class<?> cls;
        try {
            cls = Class.forName(className, false, classLoader);
        } catch (ClassNotFoundException cfne) {
            return null;
        }
        
        
        boolean interfaceMarker = cls.isInterface();
        
        Class<?>[] interfaceClses = cls.getInterfaces();
        List<String> internalInterfaceNames = new ArrayList<>(interfaceClses.length);
        for (Class<?> interfaceCls : interfaceClses) {
            internalInterfaceNames.add(Type.getInternalName(interfaceCls));
        }
        
        String internalSuperClassName;
        if (interfaceMarker) {
            // If this is an interface, it needs to mimic how class files are structured. Normally a class file will have its super class
            // set to java/lang/Object if it's an interface. This isn't exposed through the classloader. Not sure why this is like this but
            // if we encounter an interface as the class being accessed through the classloader, always override it to have a "superclass"
            // of java/lang/Object. The classloader itself would return null in this case.
            //
            // This is what ASM does internally as well when it loads info from a classloader.
            internalSuperClassName = Type.getInternalName(Object.class);
        } else {
            Class<?> superCls = cls.getSuperclass();
            internalSuperClassName = superCls == null ? null : Type.getInternalName(superCls);
        }

        return new ClassInformation(internalClassName, internalSuperClassName, internalInterfaceNames, interfaceMarker);
    }

    public  ClassLoaderClassInformationRepository(ClassLoader classLoader);

}