### Question:
DefaultKeyedValueDataset extends AbstractDataset implements KeyedValueDataset, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof KeyedValueDataset)) { return false; } KeyedValueDataset that = (KeyedValueDataset) obj; if (this.data == null) { if (that.getKey() != null || that.getValue() != null) { return false; } return true; } if (!ObjectUtilities.equal(this.data.getKey(), that.getKey())) { return false; } if (!ObjectUtilities.equal(this.data.getValue(), that.getValue())) { return false; } return true; } DefaultKeyedValueDataset();  DefaultKeyedValueDataset(Comparable key, Number value);  DefaultKeyedValueDataset(KeyedValue data); @Override Comparable getKey(); @Override Number getValue(); void updateValue(Number value); void setValue(Comparable key, Number value); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testEquals() { DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", 45.5); DefaultKeyedValueDataset d2 = new DefaultKeyedValueDataset("Test", 45.5); assertEquals(d1, d2); assertEquals(d2, d1); d1 = new DefaultKeyedValueDataset("Test 1", 45.5); d2 = new DefaultKeyedValueDataset("Test 2", 45.5); assertFalse(d1.equals(d2)); d1 = new DefaultKeyedValueDataset("Test", 45.5); d2 = new DefaultKeyedValueDataset("Test", 45.6); assertFalse(d1.equals(d2)); }