@Test
public void testHashCodeAndEquals() {

    final Map<String, JsonField> jsonFieldsRed = toMap("foo", JsonValue.of(1));
    final Map<String, JsonField> jsonFieldsBlack = toMap("foo", JsonValue.of(2));
    final ImmutableJsonObject.SoftReferencedFieldMap
            redFieldMap = ImmutableJsonObject.SoftReferencedFieldMap.of(jsonFieldsRed);
    final ImmutableJsonObject.SoftReferencedFieldMap
            blackFieldMap = ImmutableJsonObject.SoftReferencedFieldMap
            .of(jsonFieldsBlack);
    final ImmutableJsonObject redObject = ImmutableJsonObject.of(jsonFieldsRed);
    final ImmutableJsonObject blackObject = ImmutableJsonObject.of(jsonFieldsBlack);
    EqualsVerifier.forClass(ImmutableJsonObject.class)
            .withPrefabValues(ImmutableJsonObject.SoftReferencedFieldMap.class, redFieldMap, blackFieldMap)
            .withPrefabValues(ImmutableJsonObject.class, redObject, blackObject)
            .withNonnullFields("fieldMap")
            .verify();
}