class Kitap implements Runnable {

    private void discover(final Mapper mapper) {
        final JsonObject schema = records(mapper)
                .findFirst()
                .map(record -> new JsonSchemaGenerator(record.getSchema().getEntries(), jsonBuilderFactory).get())
                .orElseThrow(() -> new IllegalArgumentException(
                        "No record found for " + mapper.rootName() + '#' + mapper.name()));
        final JsonArray metadata = schema
                .getJsonObject("properties")
                .entrySet()
                .stream()
                .collect(jsonBuilderFactory::createArrayBuilder, (a, p) -> {
                    a
                            .add(jsonBuilderFactory
                                    .createObjectBuilder()
                                    .add("metadata",
                                            jsonBuilderFactory
                                                    .createObjectBuilder()
                                                    .add("inclusion", "automatic")
                                                    .add("selected-by-default", true))
                                    .add("breadcrumb",
                                            jsonBuilderFactory.createArrayBuilder().add("properties").add(p.getKey())));
                }, JsonArrayBuilder::addAll)
                .build();
        final String streams = jsonBuilderFactory
                .createObjectBuilder()
                .add("streams",
                        jsonBuilderFactory
                                .createArrayBuilder()
                                .add(jsonBuilderFactory
                                        .createObjectBuilder()
                                        .add("tap_stream_id", "default")
                                        .add("stream", "default")
                                        .add("schema", schema)
                                        .add("metadata", metadata)))
                .build()
                .toString();
        singer.stdout(streams);
    }

    public  Kitap(final String... args);
    public  Kitap(final SingerArgs args, final Singer singer);

}