protected static JsonObject mapToJson(Map<String, String> map) {
        JsonObject root = new JsonObject();
        for (Entry<String, String> entry : map.entrySet()) {
            String[] split = StringUtils.split(entry.getKey(), '.');
            ArrayDeque<String> dq = new ArrayDeque<>(Arrays.asList(split));
            createOrDescend(root, dq, entry.getValue());
        }
        return root;
    }
Common OAuth2 base.

@author Marc Savy {@literal <marc@rhymewithgravy.com>}
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/auth/AbstractOAuth2Base.java