ImmutableJsonArray extends AbstractJsonValue implements JsonArray { @Override public int hashCode() { return valueList.hashCode(); } ImmutableJsonArray(final SoftReferencedValueList theValueList); static ImmutableJsonArray empty(); static ImmutableJsonArray of(final List<JsonValue> values); static ImmutableJsonArray of(final List<JsonValue> values, @Nullable final String stringRepresentation); static ImmutableJsonArray of(final List<JsonValue> values, @Nullable final byte[] cborRepresentation); static ImmutableJsonArray of(final List<JsonValue> values, @Nullable final String stringRepresentation,
            @Nullable final byte[] cborRepresentation); @Override boolean isArray(); @Override ImmutableJsonArray asArray(); @Override ImmutableJsonArray add(final int value, final int... furtherValues); @Override ImmutableJsonArray add(final long value, final long... furtherValues); @Override ImmutableJsonArray add(final double value, final double... furtherValues); @Override ImmutableJsonArray add(final boolean value, final boolean... furtherValues); @Override ImmutableJsonArray add(final String value, final String... furtherValues); @Override ImmutableJsonArray add(final JsonValue value, final JsonValue... furtherValues); @Override Optional<JsonValue> get(final int index); @Override boolean isEmpty(); @Override int getSize(); @Override boolean contains(final JsonValue value); @Override int indexOf(final JsonValue value); @Override Iterator<JsonValue> iterator(); @Override Stream<JsonValue> stream(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override void writeValue(final SerializationContext serializationContext); @Override long getUpperBoundForStringSize();  }
@Test public void twoParsedArraysFromSameStringHaveSameHashCode() { final String jsonArrayString = "[\"latitude\", 44.673856, \"longitude\", 8.261719, \"maker\", \"ACME\"]"; final Function<String, JsonValue> parser = JsonValueParser.fromString(); final JsonValue parsedFirst = parser.apply(jsonArrayString); final JsonValue parsedSecond = parser.apply(jsonArrayString); assertThat(parsedFirst).isInstanceOf(ImmutableJsonArray.class); assertThat(parsedSecond).isInstanceOf(ImmutableJsonArray.class); assertThat(parsedFirst.hashCode()).isEqualTo(parsedSecond.hashCode()); }