### Question:
LearnerContextImpl extends AbstractContextImpl implements LearnerContext { @Override public void notifyLearnMiss( InstanceId instanceId ) { learnMissLogger.warn( "Did not have learned value for Paxos instance " + instanceId + ". " + "This generally indicates that this instance has missed too many cluster events and is " + "failing to catch up. If this error does not resolve soon it may become necessary to " + "restart this cluster member so normal operation can resume." ); } LearnerContextImpl( org.neo4j.cluster.InstanceId me, CommonContextState commonState,
                        LogProvider logging,
                        Timeouts timeouts, PaxosInstanceStore paxosInstances,
                        AcceptorInstanceStore instanceStore,
                        ObjectInputStreamFactory objectInputStreamFactory,
                        ObjectOutputStreamFactory objectOutputStreamFactory,
                        HeartbeatContext heartbeatContext ); private  LearnerContextImpl( org.neo4j.cluster.InstanceId me, CommonContextState commonState, LogProvider logging,
                                Timeouts timeouts, long lastDeliveredInstanceId, long lastLearnedInstanceId,
                                HeartbeatContext heartbeatContext,
                        AcceptorInstanceStore instanceStore, ObjectInputStreamFactory objectInputStreamFactory,
                        ObjectOutputStreamFactory objectOutputStreamFactory, PaxosInstanceStore paxosInstances ); @Override long getLastDeliveredInstanceId(); @Override void setLastDeliveredInstanceId( long lastDeliveredInstanceId ); @Override long getLastLearnedInstanceId(); @Override long getLastKnownLearnedInstanceInCluster(); @Override void setLastKnownLearnedInstanceInCluster( long lastKnownLearnedInstanceInCluster,
            org.neo4j.cluster.InstanceId instanceId ); @Override org.neo4j.cluster.InstanceId getLastKnownAliveUpToDateInstance(); @Override void learnedInstanceId( long instanceId ); @Override boolean hasDeliveredAllKnownInstances(); @Override void leave(); @Override PaxosInstance getPaxosInstance( InstanceId instanceId ); @Override AtomicBroadcastSerializer newSerializer(); @Override Iterable<org.neo4j.cluster.InstanceId> getAlive(); @Override void setNextInstanceId( long id ); @Override void notifyLearnMiss( InstanceId instanceId ); LearnerContextImpl snapshot( CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts,
                                        PaxosInstanceStore paxosInstancesSnapshot, AcceptorInstanceStore instanceStore,
                                        ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory
            objectOutputStreamFactory, HeartbeatContextImpl snapshotHeartbeatContext ); @Override boolean equals( Object o ); @Override int hashCode();  }### Answer:
@Test public void shouldOnlyLogLearnMissOnce() { final AssertableLogProvider logProvider = new AssertableLogProvider(); LearnerContextImpl ctx = new LearnerContextImpl( new InstanceId( 1 ), mock( CommonContextState.class ), logProvider, mock( Timeouts.class ), mock( PaxosInstanceStore.class ), mock( AcceptorInstanceStore.class ), mock( ObjectInputStreamFactory.class ), mock( ObjectOutputStreamFactory.class ), mock( HeartbeatContextImpl.class ) ); ctx.notifyLearnMiss( new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.InstanceId( 1L ) ); ctx.notifyLearnMiss( new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.InstanceId( 1L ) ); ctx.notifyLearnMiss( new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.InstanceId( 2L ) ); ctx.notifyLearnMiss( new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.InstanceId( 2L ) ); ctx.notifyLearnMiss( new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.InstanceId( 1L ) ); logProvider.assertExactly( inLog( LearnerState.class ).warn( containsString( "Did not have learned value for Paxos instance 1." ) ), inLog( LearnerState.class ).warn( containsString( "Did not have learned value for Paxos instance 2." ) ), inLog( LearnerState.class ).warn( containsString( "Did not have learned value for Paxos instance 1." ) ) ); }