private void appendClassAnnotations ( StringBuilder sb , FunctionType funType ) { FunctionType superConstructor = funType . getInstanceType ( ) . getSuperClassConstructor ( ) ; if ( superConstructor != null ) { ObjectType superInstance = superConstructor . getInstanceType ( ) ; if ( ! superInstance . toString ( ) . equals ( "Object" ) ) { sb . append ( " * " ) ; appendAnnotation ( sb , "extends" , superInstance . toAnnotationString ( Nullability . IMPLICIT ) ) ; sb . append ( "\n" ) ; } } // Avoid duplicates, add implemented type to a set first Set < String > interfaces = new TreeSet <> ( ) ; for ( ObjectType interfaze : funType . getAncestorInterfaces ( ) ) { interfaces . add ( interfaze . toAnnotationString ( Nullability . IMPLICIT ) ) ; } for ( String interfaze : interfaces ) { sb . append ( " * " ) ; appendAnnotation ( sb , "implements" , interfaze ) ; sb . append ( "\n" ) ; } }
we should print it first like users write it . Same for