code: private ConstraintGraph buildConstraintGraph(Map<String, DetectorNode> nodeMap, Set<DetectorFactory> factorySet,
              List<DetectorOrderingConstraint> constraintList) {
  
          ConstraintGraph result = new ConstraintGraph();
  
          for (DetectorOrderingConstraint constraint : constraintList) {
              Set<DetectorNode> earlierSet = addOrCreateDetectorNodes(constraint.getEarlier(), nodeMap, factorySet, result);
              Set<DetectorNode> laterSet = addOrCreateDetectorNodes(constraint.getLater(), nodeMap, factorySet, result);
  
              createConstraintEdges(result, earlierSet, laterSet, constraint);
          }
  
          return result;
      }
docs: Build a constraint graph. This represents ordering constraints between
  Detectors. A topological sort of the constraint graph will yield a
  correct ordering of the detectors (which may mean either passes or an
  ordering within a single pass, depending on whether the constraints are
  inter-pass or intra-pass).
  
  @param nodeMap
  map to be populated with detector class names to constraint
  graph nodes for those detectors
  @param factorySet
  build the graph using these DetectorFactories as nodes
  @param constraintList
  List of ordering constraints
  @return the ConstraintGraph