Map extends Value { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Map)) { return false; } Map<?, ?> that = (Map<?, ?>) other; return Objects.equals(pairs, that.getPairs()); } Map(List<Pair<K, V>> pairs); static Map of(java.util.Map<K, V> map); List<Pair<K, V>> getPairs(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); final String mapString; }
@Test public void testEquals() { new EqualsTester() .addEqualityGroup(map, Map.of(ImmutableMap.of("key1", "value1", "key2", "value2"))) .testEquals(); }