private static <NodeType extends IGraphNode<NodeType>> NodeType getAncestorWithLowestSemi(
      final NodeType node,
      final HashMap<NodeType, Integer> dfnum,
      final HashMap<NodeType, NodeType> semi,
      final HashMap<NodeType, NodeType> ancestor,
      final HashMap<NodeType, NodeType> best) {
    final NodeType a = ancestor.get(node);

    if (ancestor.get(a) != null) {
      final NodeType b = getAncestorWithLowestSemi(a, dfnum, semi, ancestor, best);

      ancestor.put(node, ancestor.get(a));

      if (dfnum.get(semi.get(b)) < dfnum.get(semi.get(best.get(node)))) {
        best.put(node, b);
      }
    }

    return best.get(node);
  }
In the forest, find the non-root ancestor of n that has the lowest-numbered semidominator.
java/zylib/src/main/java/com/google/security/zynamics/zylib/types/graphs/algorithms/LengauerTarjan.java