@Test @DisplayName("have `hashCode()` and `equals()`") void hashCodeAndEquals() { new EqualsTester() .addEqualityGroup(Timeout.of(5, TimeUnit.MINUTES)) .addEqualityGroup(Timeout.of(100, TimeUnit.MILLISECONDS), Timeout.of(100, TimeUnit.MILLISECONDS)) .addEqualityGroup(Timeout.of(0, TimeUnit.NANOSECONDS)) .testEquals(); }
static Timeout of(long value, TimeUnit unit) { checkNotNull(unit); return new Timeout(value, unit); }
Timeout { static Timeout of(long value, TimeUnit unit) { checkNotNull(unit); return new Timeout(value, unit); } }
Timeout { static Timeout of(long value, TimeUnit unit) { checkNotNull(unit); return new Timeout(value, unit); } private  Timeout(long value, TimeUnit unit); }
Timeout { static Timeout of(long value, TimeUnit unit) { checkNotNull(unit); return new Timeout(value, unit); } private  Timeout(long value, TimeUnit unit); @Override boolean equals(Object o); @Override int hashCode(); @Override @SuppressWarnings("DuplicateStringLiteralInspection") // local field name semantics String toString(); }
Timeout { static Timeout of(long value, TimeUnit unit) { checkNotNull(unit); return new Timeout(value, unit); } private  Timeout(long value, TimeUnit unit); @Override boolean equals(Object o); @Override int hashCode(); @Override @SuppressWarnings("DuplicateStringLiteralInspection") // local field name semantics String toString();  }