### Question:
PaxosInstanceStore { public PaxosInstance getPaxosInstance( InstanceId instanceId ) { if ( instanceId == null ) { throw new NullPointerException( "InstanceId may not be null" ); } return instances.computeIfAbsent( instanceId, i -> new PaxosInstance( this, i ) ); } PaxosInstanceStore();  PaxosInstanceStore( int maxInstancesToStore ); PaxosInstance getPaxosInstance( InstanceId instanceId ); void delivered( InstanceId instanceId ); void leave(); PaxosInstanceStore snapshot(); @Override boolean equals( Object o ); @Override int hashCode();  }### Answer:
@Test public void shouldReturnSameObjectWhenAskedById() { PaxosInstanceStore theStore = new PaxosInstanceStore(); InstanceId currentInstanceId = new InstanceId( 1 ); PaxosInstance currentInstance = theStore.getPaxosInstance( currentInstanceId ); assertSame( currentInstance, theStore.getPaxosInstance( currentInstanceId ) ); }