JsonValue implements Parcelable, JsonSerializable { private static JsonValue wrapArray(@NonNull Object array) throws JsonException { final int length = Array.getLength(array); List<JsonValue> list = new ArrayList<>(length); for (int i = 0; i < length; ++i) { Object value = Array.get(array, i); if (value != null) { list.add(wrap(value)); } } return new JsonValue(new JsonList(list)); } private  JsonValue(@Nullable Object value); @Nullable Object getValue(); @Nullable String getString(); @NonNull String getString(@NonNull String defaultValue); @NonNull String optString(); int getInt(int defaultValue); float getFloat(float defaultValue); double getDouble(double defaultValue); long getLong(long defaultValue); @Nullable Number getNumber(); boolean getBoolean(boolean defaultValue); @Nullable JsonList getList(); @NonNull JsonList optList(); @Nullable JsonMap getMap(); @NonNull JsonMap optMap(); boolean isNull(); boolean isString(); boolean isInteger(); boolean isDouble(); boolean isFloat(); boolean isLong(); boolean isNumber(); boolean isBoolean(); boolean isJsonMap(); boolean isJsonList(); @NonNull static JsonValue parseString(@Nullable String jsonString); @Override boolean equals(@Nullable Object object); @Override int hashCode(); @NonNull @Override String toString(); @NonNull static JsonValue wrap(@Nullable String value); @NonNull static JsonValue wrap(char value); @NonNull static JsonValue wrap(int value); @NonNull static JsonValue wrap(long value); @NonNull static JsonValue wrap(boolean value); @NonNull static JsonValue wrap(double value); @NonNull static JsonValue wrap(@Nullable JsonSerializable value); @NonNull static JsonValue wrapOpt(@Nullable Object object); @NonNull static JsonValue wrap(@Nullable Object object, @NonNull JsonValue defaultValue); @NonNull static JsonValue wrap(@Nullable Object object); @Override int describeContents(); @Override void writeToParcel(@NonNull Parcel dest, int flags); @NonNull @Override JsonValue toJsonValue(); @NonNull
    final static JsonValue NULL; @NonNull
    static final Parcelable.Creator<JsonValue> CREATOR; }
@Test public void testWrapArray() throws JsonException { List<Object> list = new ArrayList<>(primitiveList); list.add(primitiveMap); list.add(primitiveList); Object[] array = list.toArray(new Object[list.size()]); JsonValue jsonValue = JsonValue.wrap(list); assertTrue(jsonValue.getValue() instanceof JsonList); JsonList jsonList = jsonValue.getList(); assertNotNull(jsonList); for (int i = 0; i < array.length; i++) { JsonValue wrappedValue = JsonValue.wrap(array[i]); assertEquals(wrappedValue, jsonList.get(i)); } assertEquals(array.length, jsonList.size()); }