### Question:
SkaffoldSyncMapTemplate implements JsonTemplate { public String getJsonString() throws IOException { try (OutputStream outputStream = new ByteArrayOutputStream()) { new ObjectMapper().writeValue(outputStream, this); return outputStream.toString(); } }  @VisibleForTesting static SkaffoldSyncMapTemplate from(String jsonString); void addGenerated(FileEntry layerEntry); void addDirect(FileEntry layerEntry); String getJsonString(); @VisibleForTesting List<FileTemplate> getGenerated(); @VisibleForTesting List<FileTemplate> getDirect();  }### Answer:
@Test public void testGetJsonString() throws IOException { SkaffoldSyncMapTemplate ssmt = new SkaffoldSyncMapTemplate(); ssmt.addGenerated( new FileEntry( GEN_SRC, AbsoluteUnixPath.get("/genDest"), FilePermissions.DEFAULT_FILE_PERMISSIONS, FileEntriesLayer.DEFAULT_MODIFICATION_TIME)); ssmt.addDirect( new FileEntry( DIR_SRC_1, AbsoluteUnixPath.get("/dirDest1"), FilePermissions.DEFAULT_FILE_PERMISSIONS, FileEntriesLayer.DEFAULT_MODIFICATION_TIME)); ssmt.addDirect( new FileEntry( DIR_SRC_2, AbsoluteUnixPath.get("/dirDest2"), FilePermissions.DEFAULT_FILE_PERMISSIONS, FileEntriesLayer.DEFAULT_MODIFICATION_TIME)); Assert.assertEquals(TEST_JSON, ssmt.getJsonString()); }