ClusterRoutingTable implements RoutingTable { @Override public boolean isStaleFor( AccessMode mode ) { return expirationTimestamp < clock.millis() || routers.size() < MIN_ROUTERS || mode == AccessMode.READ && readers.size() == 0 || mode == AccessMode.WRITE && writers.size() == 0; } 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 shouldBeStaleForReadsAndWritesAfterCreation() { FakeClock clock = new FakeClock(); RoutingTable routingTable = new ClusterRoutingTable( defaultDatabase(), clock, A ); assertTrue( routingTable.isStaleFor( READ ) ); assertTrue( routingTable.isStaleFor( WRITE ) ); }