TreeNode<K> findTreeNode(int h, Object k, Class<?> kc) {
      if (k != null) {
        TreeNode<K> p = this;
        do {
          int ph, dir;
          K pk;
          TreeNode<K> q;
          TreeNode<K> pl = p.left, pr = p.right;
          if ((ph = p.hash) > h) {
            p = pl;
          } else if (ph < h) {
            p = pr;
          } else if ((pk = p.key) == k || (pk != null && k.equals(pk))) {
            return p;
          } else if (pl == null) {
            p = pr;
          } else if (pr == null) {
            p = pl;
          } else if ((kc != null || (kc = comparableClassFor(k)) != null)
              && (dir = compareComparables(kc, k, pk)) != 0) {
            p = (dir < 0) ? pl : pr;
          } else if ((q = pr.findTreeNode(h, k, kc)) != null) {
            return q;
          } else {
            p = pl;
          }
        } while (p != null);
      }
      return null;
    }
Returns the TreeNode (or null if not found) for the given key starting at given root.
geode-core/src/main/java/org/apache/geode/internal/concurrent/CompactConcurrentHashSet2.java