code: public static Duration getDuration(ProjectProperties properties, Integer durationValue, Integer unitsValue)
     {
        Duration result;
        if (durationValue == null)
        {
           result = null;
        }
        else
        {
           result = Duration.getInstance(durationValue.intValue(), TimeUnit.MINUTES);
           TimeUnit units = getDurationUnits(unitsValue);
           if (result.getUnits() != units)
           {
              result = result.convertUnits(units, properties);
           }
        }
        return (result);
     }
docs: Convert the integer representation of a duration value and duration units
  into an MPXJ Duration instance.
  
  @param properties project properties, used for duration units conversion
  @param durationValue integer duration value
  @param unitsValue integer units value
  @return Duration instance