### Question:
StreamHelper { static Ringbuffer<byte[]> getRingbuffer(HazelcastInstance instance, StreamConfig streamConfig) { final String streamFQName = Namespace.METEOR_STREAM.qualify(streamConfig.getName()); final RingbufferConfig ringbufferConfig = new RingbufferConfig(streamFQName) .setBackupCount(streamConfig.getSyncReplicas()) .setAsyncBackupCount(streamConfig.getAsyncReplicas()) .setCapacity(streamConfig.getHeapCapacity()) .setRingbufferStoreConfig(streamConfig.getRingbufferStoreConfig()); instance.getConfig().addRingBufferConfig(ringbufferConfig); return instance.getRingbuffer(streamFQName); } private  StreamHelper();   }### Answer:
@Test public void testGetRingbuffer() { final HazelcastInstance instance = mock(HazelcastInstance.class); final Config config = new Config(); when(instance.getConfig()).thenReturn(config); final RingbufferStoreConfig ringbufferStoreConfig = new RingbufferStoreConfig() .setEnabled(true) .setClassName("TestClass"); final StreamConfig streamConfig = new StreamConfig() .withName("stream") .withAsyncReplicas(3) .withSyncReplicas(2) .withHeapCapacity(100) .withRingbufferStoreConfig(ringbufferStoreConfig); StreamHelper.getRingbuffer(instance, streamConfig); verify(instance).getConfig(); final RingbufferConfig r = config.getRingbufferConfig(Namespace.METEOR_STREAM.qualify(streamConfig.getName())); assertEquals(streamConfig.getAsyncReplicas(), r.getAsyncBackupCount()); assertEquals(streamConfig.getSyncReplicas(), r.getBackupCount()); assertEquals(streamConfig.getHeapCapacity(), r.getCapacity()); assertEquals(streamConfig.getRingbufferStoreConfig(), r.getRingbufferStoreConfig()); }