code: synchronized Weight getMaximumDuration() {
          if (calcMaxDuration == null) {
              Weight max = WeightFactory.ZERO;
              for (int i = 0, n = intervals.size(); i < n; i++) {
                  Object start = intervals.get(i).getStart();
                  Map<?, Weight> d = BellmanFord.calcShortestDistances(start,
                          directedGraph, BellmanFord.Mode.SOURCE);
                  if (d == null) {
                      throw new IllegalStateException("Negative cycle detected!");
                  }
                  for (int j = 0; j < n; j++) {
                      Object finish = intervals.get(j).getFinish();
                      max = Weight.max(max, d.get(finish));
                  }
              }
              calcMaxDuration = max;
          }
  
          return calcMaxDuration;
      }
docs: Calculates and returns the maximum time distance from the start of an
  interval to the finish of an interval.
  
  @return a <code>Weight</code> object.