protected Map . Entry < TrustGraphNodeId , TrustGraphNodeId > randomRoute ( ) { final int routeNumber = rng . nextInt ( routingTable . size ( ) ) ; final Iterator < Map . Entry < TrustGraphNodeId , TrustGraphNodeId > > routes = routingTable . entrySet ( ) . iterator ( ) ; for ( int i = 0 ; i < routeNumber ; i ++ ) { routes . next ( ) ; } return routes . next ( ) ; }
internal helper method to pick a random route from the table .