public static <T extends Comparable<T>> void insertToBST(BasicNode<T> root, T valueToInsert) {
    if (null == root || null == valueToInsert) {
      throw new IllegalArgumentException("Root or value to be inserted can not be null.");
    }
    BasicNode<T> nodeToInsert = new BasicNode<T>(valueToInsert);
    BasicNode<T> nodeBeingChecked = root;
    while (true) {
      int comparison = nodeBeingChecked.getValue().compareTo(valueToInsert);
      if (comparison == 0) {
        return;
      } else if (comparison == 1) {
        if (!nodeBeingChecked.hasLeft()) {
          nodeBeingChecked.setLeft(nodeToInsert);
          return;
        }
        nodeBeingChecked = nodeBeingChecked.getLeft();
      } else {
        if (!nodeBeingChecked.hasRight()) {
          nodeBeingChecked.setRight(nodeToInsert);
          return;
        }
        nodeBeingChecked = nodeBeingChecked.getRight();
      }
    }
  }