ClusterRoutingTable implements RoutingTable { @Override public boolean hasBeenStaleFor( long extraTime ) { long totalTime = expirationTimestamp + extraTime; if ( totalTime < 0 ) { totalTime = Long.MAX_VALUE; } return totalTime < clock.millis(); } ClusterRoutingTable( DatabaseName ofDatabase, Clock clock, BoltServerAddress... routingAddresses ); private  ClusterRoutingTable( DatabaseName ofDatabase, Clock clock ); @Override boolean isStaleFor( AccessMode mode ); @Override boolean hasBeenStaleFor( long extraTime ); @Override synchronized void update( ClusterComposition cluster ); @Override synchronized void forget( BoltServerAddress address ); @Override AddressSet readers(); @Override AddressSet writers(); @Override AddressSet routers(); @Override Set<BoltServerAddress> servers(); @Override DatabaseName database(); @Override void forgetWriter( BoltServerAddress toRemove ); @Override boolean preferInitialRouter(); @Override synchronized String toString();  }
@Test void shouldHaveBeStaleForExpiredTime() throws Throwable { ClusterRoutingTable routingTable = newRoutingTable( Clock.SYSTEM ); assertTrue( routingTable.hasBeenStaleFor( 0 ) ); }
@Test void shouldNotHaveBeStaleForUnexpiredTime() throws Throwable { ClusterRoutingTable routingTable = newRoutingTable( Clock.SYSTEM ); assertFalse( routingTable.hasBeenStaleFor( Duration.ofSeconds( 30 ).toMillis() ) ); }