@Test public void convertFromMilliSecondsToSeconds() { TimeWithUnit twu = new TimeWithUnit(TimeUnit.MILLISECONDS, 123456); long duration = twu.getTime(TimeUnit.SECONDS.name()); assertThat(duration, is(123L)); }
public long getTime() { return time; }
TimeWithUnit { public long getTime() { return time; } }
TimeWithUnit { public long getTime() { return time; } private  TimeWithUnit();  TimeWithUnit(TimeUnit unit, long time); }
TimeWithUnit { public long getTime() { return time; } private  TimeWithUnit();  TimeWithUnit(TimeUnit unit, long time); String getTimeUnit(); long getTime(); long getTime(String unit); long getTime(TimeUnit unit); }
TimeWithUnit { public long getTime() { return time; } private  TimeWithUnit();  TimeWithUnit(TimeUnit unit, long time); String getTimeUnit(); long getTime(); long getTime(String unit); long getTime(TimeUnit unit);  }