public static JsonParserConcat createFlattened(final JsonParser first, final JsonParser second) {
        if (!(first instanceof JsonParserConcat) && !(second instanceof JsonParserConcat)) {
            return new JsonParserConcat(new JsonParser[]{first, second});
        } else {
            final ArrayList p = new ArrayList();
            if (first instanceof JsonParserConcat) {
                ((JsonParserConcat) first).addFlattenedActiveParsers(p);
            } else {
                p.add(first);
            }

            if (second instanceof JsonParserConcat) {
                ((JsonParserConcat) second).addFlattenedActiveParsers(p);
            } else {
                p.add(second);
            }
            return new JsonParserConcat((JsonParser[]) p.toArray(new JsonParser[p.size()]));
        }
    }
Utility class to easily concatenate multiple JsonParsers. This class had to be implemented because the class it is
extending, {@link JsonParserSequence}, inevitably skips a token when switching from one empty parser to a new one.
I.e. it is automatically calling {@link JsonParser#nextToken()} when switching to the new parser, ignoring
the current token.

This class is used for high performance in GraphSON when trying to detect types.

@author Kevin Gallardo (https://kgdo.me)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JsonParserConcat.java