code: protected void mergeSameWork(LinkedList<TimephasedWork> list)
     {
        LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
  
        TimephasedWork previousAssignment = null;
        for (TimephasedWork assignment : list)
        {
           if (previousAssignment == null)
           {
              assignment.setAmountPerDay(assignment.getTotalAmount());
              result.add(assignment);
           }
           else
           {
              Duration previousAssignmentWork = previousAssignment.getAmountPerDay();
              Duration assignmentWork = assignment.getTotalAmount();
  
              if (NumberHelper.equals(previousAssignmentWork.getDuration(), assignmentWork.getDuration(), 0.01))
              {
                 Date assignmentStart = previousAssignment.getStart();
                 Date assignmentFinish = assignment.getFinish();
                 double total = previousAssignment.getTotalAmount().getDuration();
                 total += assignmentWork.getDuration();
                 Duration totalWork = Duration.getInstance(total, TimeUnit.MINUTES);
  
                 TimephasedWork merged = new TimephasedWork();
                 merged.setStart(assignmentStart);
                 merged.setFinish(assignmentFinish);
                 merged.setAmountPerDay(assignmentWork);
                 merged.setTotalAmount(totalWork);
  
                 result.removeLast();
                 assignment = merged;
              }
              else
              {
                 assignment.setAmountPerDay(assignment.getTotalAmount());
              }
              result.add(assignment);
           }
  
           previousAssignment = assignment;
        }
  
        list.clear();
        list.addAll(result);
     }
docs: Merges individual days together into time spans where the
  same work is undertaken each day.
  
  @param list assignment data