@Test
    void testExample() throws IOException {
        final MockMetaService mockMetaService = new MockMetaService();
        final MockStore mockStreamStore = new MockStore(mockMetaService);

        mockStreamStore.clear();

        final MetaProperties metaProperties = MetaProperties.builder()
                .feedName("TEST")
                .typeName(StreamTypeNames.EVENTS)
                .build();

        Meta meta = null;
        try (final Target streamTarget = mockStreamStore.openTarget(metaProperties)) {
            meta = streamTarget.getMeta();

            try (final OutputStreamProvider outputStreamProvider = streamTarget.next()) {
                try (final OutputStream outputStream = outputStreamProvider.get()) {
                    outputStream.write("PARENT".getBytes(StreamUtil.DEFAULT_CHARSET));
                }
                try (final OutputStream outputStream = outputStreamProvider.get(StreamTypeNames.CONTEXT)) {
                    outputStream.write("CHILD".getBytes(StreamUtil.DEFAULT_CHARSET));
                }
            }

            assertThat(mockMetaService.find(FindMetaCriteria.createFromMeta(meta)).size()).isEqualTo(0);
        }

        assertThat(mockMetaService.find(FindMetaCriteria.createFromMeta(meta)).size()).isEqualTo(1);

        final Meta reload = mockMetaService.find(FindMetaCriteria.createFromMeta(meta)).getFirst();

        try (final Source streamSource = mockStreamStore.openSource(reload.getId())) {
            try (final InputStreamProvider inputStreamProvider = streamSource.get(0)) {
                String testMe = StreamUtil.streamToString(inputStreamProvider.get());
                assertThat(testMe).isEqualTo("PARENT");
                testMe = StreamUtil.streamToString(inputStreamProvider.get(StreamTypeNames.CONTEXT));
                assertThat(testMe).isEqualTo("CHILD");
            }
        }
    }
<p>
Test the mock as it is quite complicated.
</p>
stroom-data/stroom-data-store-mock/src/test/java/stroom/data/store/mock/TestMockStreamStore.java