Buggy code:
} ; private final InMemData data ; private final String asUsername ; private Thread persistor ; private final boolean sudo ; @ SuppressWarnings ( "serial" ) public InMem ( String filename , EntitySerializer serializer , EntityConstructor constructor , final Set < Class < ? > > relClasses , String asUsername ) { } private InMem ( InMemData data , String asUsername , Thread persistor , boolean sudo ) { } protected String username ( ) { } public void initAndLoad ( ) { } private void resolveDoubleFileInconsistency ( ) { } private void load ( ) { } public long insert ( Object record ) { } private void updateChangesFromRels ( Object entity ) { } private void deleteRelsFor ( Object entity ) { } private boolean hasEntityLinks ( Object value ) { } private EntityLinks entityLinks ( Object value ) { } private void propageteRelChanges ( Object entity , Prop prop , EntityLinks links , long fromId , Collection < Long > addToIds , Collection < Long > delToIds ) { } private RelPair getRelPair ( Object entity , Prop prop , String rel , boolean inverse ) { } private Prop findRelProperty ( Class < ? > fromCls , String rel , Class < ? > toCls ) { } private void relLink ( String relation , Prop srcProp , long fromId , Prop destProp , long toId ) { } private void relUnlink ( String relation , Prop srcProp , long fromId , Prop destProp , long toId ) { } public void delete ( long id ) { } public void delete ( Object record ) { } public < E > E get ( long id ) { } public < E > E getIfExists ( long id ) { } private < E > E get_ ( long id , boolean validateId ) { } public < E > E get ( long id , Class < E > clazz ) { } public void refresh ( Object record ) { } private Rec getRec ( long id ) { } public void update ( long id , Object record ) { } private void update_ ( long id , Object record , boolean reflectRelChanges , boolean checkSecurity ) { } private static void occErrorIf ( boolean errCond , String msg , long id ) { } public void update ( Object record ) { } public long persist ( Object record ) { } public long persistedIdOf ( Object record ) { } public < T > T readColumn ( long id , String column ) { } public < E > List < E > getAll ( final Class < E > clazz ) { } protected < E > List < E > sorted ( List < E > records , Comparator < E > orderBy ) { } @ SuppressWarnings ( "unchecked" ) public < E > List < E > getAll ( long [ ] ids ) { } @ SuppressWarnings ( "unchecked" ) public < E > List < E > getAll ( Collection < Long > ids ) { } public < E > List < E > find ( final Predicate < E > match ) { } @ SuppressWarnings ( "unchecked" ) public < E > List < E > find ( Iterable < Long > ids ) { } private < E > E getIfAllowed ( long id , boolean validateId ) { } private < E > E getIfAllowedOrNull ( long id , boolean validateId ) { } private < E > E getIfAllowed ( long id , Class < E > type ) { } public < E > List < E > find ( final Class < E > clazz , final Predicate < E > match , final Comparator < E > orderBy ) { Predicate < E > match2 = new Predicate < E > ( ) { @ Override public boolean eval ( E record ) throws Exception { return ( clazz . isAssignableFrom ( record . getClass ( ) ) ) && ( ( match == null ) || ( match . eval ( record ) ) ) ; } } ; <START_BUG> return find ( match2 ) ; <END_BUG> } public < E > List < E > find ( String searchPhrase ) { } public < E > List < E > find ( final Class < E > clazz , final String query , final Object ... args ) { } public static boolean matches ( Object record , String query , Object ... args ) { } public < E > void each ( final Operation < E > lambda ) { } public void transaction ( Runnable transaction , boolean readOnly ) { } public void transaction ( Runnable transaction , boolean readOnly , Callback < Void > txCallback ) { } private void txRollback ( ) { } private < T > T get_ ( long id , Class < T > clazz ) { } private void sharedLock ( ) { } private void sharedUnlock ( ) { } private void globalLock ( ) { } private void globalUnlock ( ) { } private void validateId ( long id ) { } private IllegalArgumentException invalidId ( long id ) { } public void saveTo ( final OutputStream output ) { } public Map < String , Object > loadMetadata ( InputStream in ) { } public void loadFrom ( InputStream in ) { } private void persistTo ( RandomAccessFile file ) throws IOException { } private Map < String , Object > metadata ( ) { } @ SuppressWarnings ( "unchecked" ) private void persistData ( ) { } private void invokeCallbacks ( Callback < Void > [ ] callbacks , Throwable e ) { } private File currentFile ( ) { } private File otherFile ( ) { } private String filenameWithSuffix ( String suffixAorB ) { }

Fix:
return sorted ( find ( match2 ) , orderBy ) ;