public static void validateDuplicateTargets(AntDomProject project, final TargetSink sink) {
    final TargetResolver resolver = new TargetResolver(Collections.emptyList(), null) {
      @Override
      protected void duplicateTargetFound(AntDomTarget existingTarget, AntDomTarget duplicatingTarget, String taregetEffectiveName) {
        sink.duplicateTargetDetected(existingTarget, duplicatingTarget, taregetEffectiveName);
      }

      @Override
      protected void stageCompleted(Stage completedStage, Stage startingStage) {
        if (Stage.RESOLVE_MAP_BUILDING_STAGE.equals(completedStage)) {
          stop();
        }
      }
    };
    resolver.execute(project, null);
  }
public static void validateDuplicateTargets(AntDomProject project, final TargetSink sink)