code: private Duration assignmentDuration(Task task, Duration work)
     {
        Duration result = work;
  
        if (result != null)
        {
           if (result.getUnits() == TimeUnit.PERCENT)
           {
              Duration taskWork = task.getWork();
              if (taskWork != null)
              {
                 result = Duration.getInstance(taskWork.getDuration() * result.getDuration(), taskWork.getUnits());
              }
           }
        }
        return result;
     }
docs: Extract a duration amount from the assignment, converting a percentage
  into an actual duration.
  
  @param task parent task
  @param work duration from assignment
  @return Duration instance