TimesheetDayEntry implements Serializable { public float getEffectiveDurationHours() { if (getHours() == null) { return 0.0f; } if (!getHours().matches("\\d\\d?:\\d\\d")) { return 0.0f; } String[] hours = getHours().split(":"); return (Integer.parseInt(hours[0]) * 1.0f) + ((Integer.parseInt(hours[1]) * 1.0f) / 60.0f); } TimesheetDayEntry(); Project getProject(); void setProject(Project project); String getHours(); void setHours(String hours); float getEffectiveDurationHours();  }
@Test public void testGetEffectiveDurationHours() { entry.setHours("01:30"); assertEquals(1.5f, entry.getEffectiveDurationHours(), Float.MIN_NORMAL); }