class JsonCnd {

    static <D, K extends KeyDefinitionToken<?, D>> JsonValue
    internalWriteAllJson(final @NotNull D def,
                         final @NotNull NamePathResolver resolver,
                         final @NotNull K[] tokens) {
        return Stream.of(tokens)
                .filter(DefinitionToken::nonUnknown)
                .map(key -> toEntry(key.getToken(), key.writeJson(def, resolver)))
                .filter(testValue(JavaxJson::nonEmptyValue))
                .collect(JsonCollectors.toJsonObject());
    }

    private  JsonCnd();

}