static <V> boolean checkInvariants(TreeNode<V> t) {
          TreeNode<V> tp = t.parent, tl = t.left, tr = t.right,
              tb = t.prev, tn = (TreeNode<V>)t.next;
        if (tb != null && tb.next != t) {
          return false;
        }
        if (tn != null && tn.prev != t) {
          return false;
        }
        if (tp != null && t != tp.left && t != tp.right) {
          return false;
        }
        if (tl != null && (tl.parent != t || tl.hash > t.hash)) {
          return false;
        }
        if (tr != null && (tr.parent != t || tr.hash < t.hash)) {
          return false;
        }
        if (t.red && tl != null && tl.red && tr != null && tr.red) {
          return false;
        }
        if (tl != null && !checkInvariants(tl)) {
          return false;
        }
        if (tr != null && !checkInvariants(tr)) {
          return false;
        }
          return true;
      }
static <V> boolean checkInvariants(TreeNode<V> t)