FileSdConfig { public String toJson() { ObjectMapper mapper = JsonUtil.getMapper(); try { return mapper.writeValueAsString(this.entries); } catch (Exception e) { throw new IllegalStateException("The entries are invalid: " + this.entries); } } FileSdConfig(); void addEntry(Entry entry); List<Entry> getEntries(); String toJson(); static FileSdConfig fromJson(String json);  }
@Test public void testEmptyJson() throws Exception { FileSdConfig config = new FileSdConfig(); String json = config.toJson(); Assert.assertEquals("[]", json); }