Duration { public static Duration minutes(Integer minutes) { return new Duration(minutes * 60L); } Duration();  Duration(Long seconds); static Duration minutes(Integer minutes); static Duration hours(Integer hours); static Duration seconds(Long seconds); Long asMills(); @Override boolean equals(Object o); @Override int hashCode(); public Long seconds; }
@Test public void minutesCalculation() throws Exception { Duration expectedDuration = minutes(60); Duration actualDuration = new Duration(3600L); assertThat(expectedDuration, is(actualDuration)); }