@Test void toString_should_contain_units_and_be_human_readable() { assertThat(Distance.ofMillis(3600_000 * 37 + 60_000 * 3 + 24_000)).hasToString("37h 3m 24s 0ms"); assertThat(Distance.ofMillis(3601_000)).hasToString("1h 0m 1s 0ms"); assertThat(Distance.ofMillis(5_123)).hasToString("0h 0m 5s 123ms"); }
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; }