@Test void equals_hashCode() { long millis = 37; Distance distance = Distance.ofMillis(millis); assertThat(distance) .isEqualTo(distance) .isEqualTo(Distance.ofMillis(millis)) .isNotEqualTo(null) .isNotEqualTo(millis) .isNotEqualTo(Distance.ofMillis(millis + 1)) .hasSameHashCodeAs(Distance.ofMillis(millis)); }
public static Distance ofMillis(long millis) { return new Distance(millis); }
Distance { public static Distance ofMillis(long millis) { return new Distance(millis); } }
Distance { public static Distance ofMillis(long millis) { return new Distance(millis); } private  Distance(long millis); }
Distance { public static Distance ofMillis(long millis) { return new Distance(millis); } private  Distance(long millis); static Distance ofMillis(long millis); long millis(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Distance { public static Distance ofMillis(long millis) { return new Distance(millis); } private  Distance(long millis); static Distance ofMillis(long millis); long millis(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Distance ZERO; }