public double testMove(Board testBoard, Piece move) {
    PieceColor myColor = this.player.getColor();
    PieceColor theirColor = myColor.getOpposite();
    testBoard = testBoard.getDeepCopy();
    ArrayList<Piece> validMoves = new ArrayList<Piece>();
    ArrayList<Piece> nextValidMoves = new ArrayList<Piece>();
    int maxDepth = 30;
    int movesLeft = (64 - (testBoard.getPieceCount(myColor) + testBoard.getPieceCount(theirColor))) / 2;
    
    if(maxDepth > movesLeft) {
      maxDepth = movesLeft - 1;
    }
    
    testBoard.makeMove(move);
    validMoves = testBoard.getValidMoves(move.getColor().getOpposite());
    nextValidMoves = testBoard.getValidMoves(move.getColor());
    
    if(validMoves.size() == 0 && nextValidMoves.size() > 0) {
      validMoves = nextValidMoves;
    }
    
    if(depth > maxDepth) {
      return (double)testBoard.getPieceCount(myColor) / (double)testBoard.getPieceCount(theirColor);
    }
    depth++;
    
    if(validMoves.size() > 0) {
      int bestMove = 0;
      
      if(validMoves.size() > 1) {
        bestMove = getBestMove(testBoard, validMoves);
      }
      
      return testMove(testBoard, validMoves.get(bestMove));
    } else {
      return (double)testBoard.getPieceCount(myColor) / (double)testBoard.getPieceCount(theirColor);
    }
  }