@ Override public List < Pair < Long , String > > getLastNRegisteredInstances ( ) { List < Pair < Long , String > > list = new ArrayList < Pair < Long , String > > ( ) ; synchronized ( recentRegisteredQueue ) { for ( Pair < Long , String > aRecentRegisteredQueue : recentRegisteredQueue ) { list . add ( aRecentRegisteredQueue ) ; } } Collections . reverse ( list ) ; return list ; }
Get the N instances that are most recently registered .