### Question:
JarExportStrategy implements ExportStrategy { protected void saveTransformedClasses(final JarOutputStream jarOS, final Map<String, InstrumentedClassState> instrumented) { log.info(PreprocessConstants.MESSAGE_PREFIX + "Transformed " + instrumented.size() + " classes."); for (Map.Entry<String, InstrumentedClassState> mapEntry : instrumented.entrySet()) { final String classPath = mapEntry.getKey(); final InstrumentedClassState info = mapEntry.getValue(); final JarEntry entry = new JarEntry(classPath + ".class"); try { jarOS.putNextEntry(entry); jarOS.write(info.getClassBytes()); jarOS.closeEntry(); } catch (IOException e) { throw new ExportException(classPath, e); } } }  @Override void export(final JarInfo jarInfo, final Map<String, InstrumentedClassState> instrumented, final PreprocessConfig config);  }### Answer:
@Test public void testSaveTransformedClassesWorksAndCreatesNewEntries() throws IOException { spyStrategy.saveTransformedClasses(mockJarOS, MockEntities.makeInstrumentedClassesMap()); ArgumentCaptor<JarEntry> jarEntryArgument = ArgumentCaptor.forClass(JarEntry.class); Mockito.verify(mockJarOS, Mockito.times(3)).putNextEntry(jarEntryArgument.capture()); Assert.assertTrue(jarEntryArgument.getAllValues().size() == 3); ArgumentCaptor<byte[]> byteArrayArgument = ArgumentCaptor.forClass(byte[].class); Mockito.verify(mockJarOS, Mockito.times(3)).write(byteArrayArgument.capture()); Assert.assertTrue(byteArrayArgument.getAllValues().size() == 3); Mockito.verify(mockJarOS, Mockito.times(3)).closeEntry(); }