ManifestGenerator { public String generateJson(Manifest manifest) throws JsonProcessingException { ObjectMapper mapper = new IiifPresentationApiObjectMapper(); String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(manifest); return json; } ManifestGenerator(); static void main(String[] args); String generateJson(Manifest manifest);  }
@Test public void testGenerateJson() throws JsonProcessingException { String urlPrefix = "http: Manifest manifest = new ManifestImpl(URI.create(urlPrefix + "/demo/bookreader/manifest.json"), new PropertyValueSimpleImpl("Walters MS 168")); List<Sequence> sequences = new ArrayList<>(); manifest.setSequences(sequences); Sequence seq1 = new SequenceImpl(new PropertyValueSimpleImpl("Current page order")); seq1.setId(urlPrefix + "/demo/bookreader/normal"); sequences.add(seq1); List<Canvas> canvases = new ArrayList<>(); seq1.setCanvases(canvases); addPage(urlPrefix, canvases); ManifestGenerator mg = new ManifestGenerator(); String json = mg.generateJson(manifest); System.out.println(json); Assert.assertTrue(json.contains("{")); }