@Test public void testEquals() { TimestampSet set1 = new TimestampSet(); set1.add(6.0); set1.add(1.0); TimestampSet set2 = new TimestampSet(); set2.add(6.0); set2.add(1.0); TimestampSet set3 = new TimestampSet(); set3.add(6.0); set3.add(2.0); Assert.assertTrue(set1.equals(set2)); Assert.assertTrue(set2.equals(set1)); Assert.assertFalse(set1.equals(set3)); Assert.assertFalse(set3.equals(set1)); Assert.assertTrue(set1.hashCode() == set2.hashCode()); Assert.assertFalse(set1.hashCode() == set3.hashCode()); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimestampSet other = (TimestampSet) obj; if (this.size != other.size) { return false; } for (int i = 0; i < size; i++) { double i1 = this.array[i]; double i2 = other.array[i]; if (i1 != i2) { return false; } } return true; }
TimestampSet implements TimeSet<Double> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimestampSet other = (TimestampSet) obj; if (this.size != other.size) { return false; } for (int i = 0; i < size; i++) { double i1 = this.array[i]; double i2 = other.array[i]; if (i1 != i2) { return false; } } return true; } }
TimestampSet implements TimeSet<Double> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimestampSet other = (TimestampSet) obj; if (this.size != other.size) { return false; } for (int i = 0; i < size; i++) { double i1 = this.array[i]; double i2 = other.array[i]; if (i1 != i2) { return false; } } return true; } TimestampSet();  TimestampSet(int capacity);  TimestampSet(double[] arr); }
TimestampSet implements TimeSet<Double> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimestampSet other = (TimestampSet) obj; if (this.size != other.size) { return false; } for (int i = 0; i < size; i++) { double i1 = this.array[i]; double i2 = other.array[i]; if (i1 != i2) { return false; } } return true; } TimestampSet();  TimestampSet(int capacity);  TimestampSet(double[] arr); @Override boolean add(Double timestamp); @Override boolean remove(Double timestamp); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Double timestamp); @Override Double[] toArray(); @Override double[] toPrimitiveArray(); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object obj); String toString(TimeFormat timeFormat, DateTimeZone timeZone); String toString(TimeFormat timeFormat); @Override String toString(); }
TimestampSet implements TimeSet<Double> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimestampSet other = (TimestampSet) obj; if (this.size != other.size) { return false; } for (int i = 0; i < size; i++) { double i1 = this.array[i]; double i2 = other.array[i]; if (i1 != i2) { return false; } } return true; } TimestampSet();  TimestampSet(int capacity);  TimestampSet(double[] arr); @Override boolean add(Double timestamp); @Override boolean remove(Double timestamp); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Double timestamp); @Override Double[] toArray(); @Override double[] toPrimitiveArray(); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object obj); String toString(TimeFormat timeFormat, DateTimeZone timeZone); String toString(TimeFormat timeFormat); @Override String toString();  }