@Override
    public void print(Collection<TableModel> models) {
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        JsonObject jsonRoot = new JsonObject();

        if (file != null) {
            jsonRoot.add("file", new JsonPrimitive(file.toString()));
        }

        models.forEach(model -> {
            jsonRoot.add(model.name().toLowerCase(), tableToJson(model.table(), gson));
        });

        gson.toJson(jsonRoot, out);
    }
@author Nico Bergemann <barracuda415 at yahoo.de>
disunity-cli/src/main/java/info/ata4/disunity/cli/util/JsonTablePrinter.java