private static boolean allImplementationsDerivedFromSubclass(@SlashedClassName String superClass, @SlashedClassName String subClass) {
        ClassDescriptor superDescriptor = DescriptorFactory.createClassDescriptor(superClass);
        XClass xClass = AnalysisContext.currentXFactory().getXClass(superDescriptor);
        if(xClass == null || (!xClass.isInterface() && !xClass.isAbstract())) {
            return false;
        }
        try {
            ClassDescriptor wantedDescriptor = DescriptorFactory.createClassDescriptor(subClass);
            Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
            for (ClassDescriptor subDescriptor : subtypes2.getSubtypes(superDescriptor)) {
                if (subDescriptor.equals(superDescriptor) || subDescriptor.equals(wantedDescriptor)) {
                    continue;
                }
                XClass xSubClass = AnalysisContext.currentXFactory().getXClass(subDescriptor);
                if (xSubClass == null
                        || (!xSubClass.isAbstract() && !xSubClass.isInterface() && !subtypes2.isSubtype(subDescriptor,
                                wantedDescriptor))) {
                    return false;
                }
            }
            return true;
        } catch (ClassNotFoundException e) {
            // unresolved class
        }
        return false;
    }
private static boolean allImplementationsDerivedFromSubclass ( @ SlashedClassName String superClass , @ SlashedClassName String subClass ) { ClassDescriptor superDescriptor = DescriptorFactory . createClassDescriptor ( superClass ) ; XClass xClass = AnalysisContext . currentXFactory ( ) . getXClass ( superDescriptor ) ; if ( xClass == null || ( ! xClass . isInterface ( ) && ! xClass . isAbstract ( ) ) ) { return false ; } try { ClassDescriptor wantedDescriptor = DescriptorFactory . createClassDescriptor ( subClass ) ; Subtypes2 subtypes2 = AnalysisContext . currentAnalysisContext ( ) . getSubtypes2 ( ) ; for ( ClassDescriptor subDescriptor : subtypes2 . getSubtypes ( superDescriptor ) ) { if ( subDescriptor . equals ( superDescriptor ) || subDescriptor . equals ( wantedDescriptor ) ) { continue ; } XClass xSubClass = AnalysisContext . currentXFactory ( ) . getXClass ( subDescriptor ) ; if ( xSubClass == null || ( ! xSubClass . isAbstract ( ) && ! xSubClass . isInterface ( ) && ! subtypes2 . isSubtype ( subDescriptor , wantedDescriptor ) ) ) { return false ; } } return true ; } catch ( ClassNotFoundException e ) { } return false ; }
@param superClass
@param subClass
@return true if superClass is abstract or interface and all known non-abstract implementations
are derived from given subClass