### Question:
Singer { public synchronized void writeSchema(final String stream, final JsonObject schema, final JsonArray keys, final JsonArray bookmarks) { final JsonObject json = builderFactory .createObjectBuilder() .add("type", "SCHEMA") .add("stream", requireNonNull(stream, "stream can't be null")) .add("schema", schema) .add("key_properties", keys) .add("bookmark_properties", bookmarks) .build(); runIo.getStdout().println(json); } Singer(); String formatDate(final ZonedDateTime dateTime); synchronized void writeState(final JsonObject state); synchronized void writeSchema(final String stream, final JsonObject schema, final JsonArray keys,
            final JsonArray bookmarks); synchronized void writeRecord(final String stream, final JsonObject record); synchronized void stdout(final String message); synchronized void stderr(final String message);  }### Answer:
@Test void writeShema() throws UnsupportedEncodingException { write(s -> s .writeSchema("test_stream", Json.createObjectBuilder().add("id", 1).add("name", "Test").build(), Json.createArrayBuilder().add("foo").build(), Json.createArrayBuilder().add("bar").build()), "{\"type\":\"SCHEMA\",\"stream\":\"test_stream\",\"schema\":{\"id\":1,\"name\":\"Test\"},\"key_properties\":[\"foo\"],\"bookmark_properties\":[\"bar\"]}"); }