public static void DFSTest(WUGraph g, WUGraph t, DFSVertex[] vertArray) {
    int[][] maxOnPath;
    Neighbors neigh;
    int i, j;

    System.out.println("Testing the tree.");

    maxOnPath = new int[VERTICES][VERTICES];
    for (i = 0; i < VERTICES; i++) {
      for (j = 0; j < VERTICES; j++) {
        vertArray[j].visited = false;
      }
      DFS(t, vertArray[i], null, maxOnPath[i], -MAXINT);
      for (j = 0; j < VERTICES; j++) {
        if (!vertArray[j].visited) {
          tree = false;
        }
      }
      if (!tree) {
        return;
      }
    }

//  for (i = 0; i < vertArray.length; i++) {
//    for (j = 0; j < vertArray.length; j++) {
//      System.out.print(" " + maxOnPath[i][j]);
//    }
//    System.out.println();
//  }

    for (i = 0; i < VERTICES; i++) {
      neigh = g.getNeighbors(vertArray[i]);
      if (neigh != null) {
        for (j = 0; j < neigh.neighborList.length; j++) {
          int v = ((DFSVertex) neigh.neighborList[j]).number;
          if (neigh.weightList[j] < maxOnPath[i][v]) {
            minTree = false;
          }
        }
      }
    }
  }