### Question:
TimePeriod implements Comparable<TimePeriod> { public static long convertToHours(TimePeriod duration) { return TimeUnit.SECONDS.toHours(duration.getDuration()); } TimePeriod(long startTime, long endTime);  TimePeriod(Calendar startTime, Calendar endTime);  TimePeriod(Calendar startTime, long seconds);  TimePeriod(Calendar startTime, int time, TimeUnit sourceUnit);  TimePeriod(int time, TimeUnit sourceUnit); long getDuration(); static long convertToMinutes(TimePeriod duration); static long convertToHours(TimePeriod duration); static long convertToDays(TimePeriod duration); Calendar getStartTime(); long getStartTimeInSeconds(); Calendar getEndTime(); long getEndTimeInSeconds(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod other); @Override String toString(); boolean isValid();  }### Answer:
@Test public void testConvertToHours() { System.out.println("convertToHours"); TimePeriod duration = new TimePeriod(time1, time2); long expResult = 10L; long result = TimePeriod.convertToHours(duration); assertEquals(expResult, result); }