### Question:
SkaffoldFilesOutput { public String getJsonString() throws IOException { try (OutputStream outputStream = new ByteArrayOutputStream()) { new ObjectMapper().writeValue(outputStream, skaffoldFilesTemplate); return outputStream.toString(); } } SkaffoldFilesOutput(); @VisibleForTesting  SkaffoldFilesOutput(String json); void addBuild(Path build); void addInput(Path inputFile); void addIgnore(Path ignoreFile); @VisibleForTesting List<String> getBuild(); @VisibleForTesting List<String> getInputs(); @VisibleForTesting List<String> getIgnore(); String getJsonString();  }### Answer:
@Test public void testGetJsonString() throws IOException { SkaffoldFilesOutput skaffoldFilesOutput = new SkaffoldFilesOutput(); skaffoldFilesOutput.addBuild(Paths.get("buildFile1")); skaffoldFilesOutput.addBuild(Paths.get("buildFile2")); skaffoldFilesOutput.addInput(Paths.get("input1")); skaffoldFilesOutput.addInput(Paths.get("input2")); skaffoldFilesOutput.addIgnore(Paths.get("ignore1")); skaffoldFilesOutput.addIgnore(Paths.get("ignore2")); Assert.assertEquals(TEST_JSON, skaffoldFilesOutput.getJsonString()); }
@Test public void testGetJsonString_empty() throws IOException { SkaffoldFilesOutput skaffoldFilesOutput = new SkaffoldFilesOutput(); Assert.assertEquals( "{\"build\":[],\"inputs\":[],\"ignore\":[]}", skaffoldFilesOutput.getJsonString()); }