((NewTimeSpan)first).setTimeSpan(firstlap.getStartTime(), end); ((NewTimeSpan)second).setTimeSpan(start, firstlap.getStartTime());
if (! (isValidSpan(firstlap.getStartTime(), end) && isValidSpan(start, firstlap.getStartTime()))) { return Collections.EMPTY_LIST; } ((NewTimeSpan) first).setTimeSpan(firstlap.getStartTime(), end); ((NewTimeSpan) second).setTimeSpan(start, firstlap.getStartTime());
  protected List getNewTaskSplitTimes(Task task, HashMap provHashMap) {    ArrayList splits = new ArrayList();    long start = TaskUtils.getStartTime(task);    long end = TaskUtils.getEndTime(task);    Collection values = provHashMap.values();    Schedule tmp = new ScheduleImpl();    Iterator valIt = values.iterator();    while (valIt.hasNext()) {      Schedule sched = (Schedule) valIt.next();      tmp.addAll(sched);    }    Collection overlaps = tmp.getOverlappingScheduleElements(start, end);    if (overlaps.isEmpty()) {      return splits;    }    ScheduleElement firstlap = (ScheduleElement) overlaps.iterator().next();    TimeSpan first = new MutableTimeSpan();    TimeSpan second = new MutableTimeSpan();    if (start >= firstlap.getStartTime()) {      ((NewTimeSpan)first).setTimeSpan(start, firstlap.getEndTime());      ((NewTimeSpan)second).setTimeSpan(firstlap.getEndTime(), end);    } else {      ((NewTimeSpan)first).setTimeSpan(firstlap.getStartTime(), end);      ((NewTimeSpan)second).setTimeSpan(start, firstlap.getStartTime());    }    splits.add(first);    splits.add(second);    return splits;  }