public static <T> Json asArray(JsonObjectConverter<T> converter,
            T... objects) {

        final Json json = Json.newArray();

        if (objects == null || objects.length == 0) {
            return json;
        }

        Iterator<T> iterator = Arrays.asList(objects).iterator();
        while (iterator.hasNext()) {
            T obj = iterator.next();
            converter.convert(json, obj);

            if (iterator.hasNext()) {
                json.nextArrayElement();
            }
        }
        return json;
    }