@Test
public void testMultipleFilesAtLimitWithContextSameFeed() throws IOException {

    init();
    final StroomZipRepository proxyRepository = proxyRepositoryManager.getActiveRepository();
    final StroomZipOutputStream stroomZipOutputStream1 = proxyRepository.getStroomZipOutputStream();
    for (int i = 0; i < 10; i++) {
        StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
                new StroomZipEntry(null, String.valueOf(i), StroomZipFileType.Meta),
                "Feed:TEST\nGUID:Z1\n".getBytes(StreamUtil.DEFAULT_CHARSET));
        StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
                new StroomZipEntry(null, String.valueOf(i), StroomZipFileType.Data),
                "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
        StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
                new StroomZipEntry(null, String.valueOf(i), StroomZipFileType.Context),
                "Test Context".getBytes(StreamUtil.DEFAULT_CHARSET));
    }
    stroomZipOutputStream1.close();
    final StroomZipOutputStream stroomZipOutputStream2 = proxyRepository.getStroomZipOutputStream();
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.header", "req", StroomZipFileType.Meta),
            "Feed:TEST\nGUID:Z2\n".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.data", "req", StroomZipFileType.Data),
            "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.context", "req", StroomZipFileType.Context),
            "Test Context".getBytes(StreamUtil.DEFAULT_CHARSET));
    stroomZipOutputStream2.close();
    final StroomZipOutputStream stroomZipOutputStream3 = proxyRepository.getStroomZipOutputStream();
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream3,
            new StroomZipEntry("req.header", "req", StroomZipFileType.Meta),
            "Feed:TEST\nGUID:Z2\n".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream3,
            new StroomZipEntry("req.data", "req", StroomZipFileType.Data),
            "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream3,
            new StroomZipEntry("req.context", "req", StroomZipFileType.Context),
            "Test Context".getBytes(StreamUtil.DEFAULT_CHARSET));
    stroomZipOutputStream3.close();
    proxyRepositoryReader.setMaxAggregation(10);
    proxyRepositoryReader.doRunWork();
    Assert.assertEquals(2, mockRequestHandler.getHandleHeaderCount());
    Assert.assertEquals(2, mockRequestHandler.getHandleFooterCount());
    proxyRepository.clean();
    Assert.assertFalse(isZipFile(proxyRepository, 1));
    Assert.assertFalse(isZipFile(proxyRepository, 2));
}