### Question:
MetricsRegistry { public Map<String, Queue<IMetricsSnapshot>> getSnapshotLists() { return snapshotLists; } private  MetricsRegistry(); static MetricsRegistry getInstance(); void addSnapshot( ILogChannel logChannel, IMetricsSnapshot snapshot ); Map<String, Queue<IMetricsSnapshot>> getSnapshotLists(); Map<String, Map<String, IMetricsSnapshot>> getSnapshotMaps(); Queue<IMetricsSnapshot> getSnapshotList( String logChannelId ); Map<String, IMetricsSnapshot> getSnapshotMap( String logChannelId ); void reset();  }### Answer:
@Test public void testConcurrencySnap() throws Exception { ExecutorService service = Executors.newFixedThreadPool( threadCount ); for ( int i = 0; i < threadCount; i++ ) { service.submit( new ConcurrentPutIfAbsent( logIds.get( i % 20 ) ) ); } countDownLatch.countDown(); service.awaitTermination( 2000, TimeUnit.MILLISECONDS ); int expectedQueueCount = logChannelIdCount > threadCount ? threadCount : logChannelIdCount; assertEquals( expectedQueueCount, metricsRegistry.getSnapshotLists().size() ); }