### Question:
LoggingResourcePoolMonitor extends ResourcePool.Monitor.Adapter<ChannelContext> { @Override public void updatedCurrentPeakSize( int currentPeakSize ) { if ( lastCurrentPeakSize != currentPeakSize ) { msgLog.debug( "ResourcePool updated currentPeakSize to " + currentPeakSize ); lastCurrentPeakSize = currentPeakSize; } } LoggingResourcePoolMonitor( Log msgLog ); @Override void updatedCurrentPeakSize( int currentPeakSize ); @Override void created( ChannelContext resource ); @Override void updatedTargetSize( int targetSize );  }### Answer:
@Test public void testUpdatedCurrentPeakSizeLogsOnlyOnChange() { Log log = mock( Log.class ); LoggingResourcePoolMonitor monitor = new LoggingResourcePoolMonitor( log ); monitor.updatedCurrentPeakSize( 10 ); verify( log, times( 1 ) ).debug( anyString() ); monitor.updatedCurrentPeakSize( 10 ); verify( log, times( 1 ) ).debug( anyString() ); monitor.updatedCurrentPeakSize( 11 ); verify( log, times( 2 ) ).debug( anyString() ); }