private boolean methodHasSyntheticTwin ( String methodName , String methodSig ) { for ( Method m : cls . getMethods ( ) ) { if ( m . isSynthetic ( ) && m . getName ( ) . equals ( methodName ) && ! m . getSignature ( ) . equals ( methodSig ) ) { return true ; } } return false ; }
returns whether this method has an equivalent method that is synthetic which implies this method is constrained by some Generified interface . We could compare parameters but that is a bunch of work that probably doesn t make this test any more precise so just return true if method name and synthetic is found .