private List<Set<LineageLogger.Vertex>>  getVerticesFromHooks() {
    List<Set<LineageLogger.Vertex>> verticesLists = new ArrayList<>();
    List<HookContext> hookList = ReadableHook.getHookList();
    for (HookContext hookContext : hookList) {
      QueryPlan plan = hookContext.getQueryPlan();
      LineageCtx.Index index = hookContext.getIndex();
      assertNotNull(index);
      List<LineageLogger.Edge> edges = LineageLogger.getEdges(plan, index);
      Set<LineageLogger.Vertex> vertices = LineageLogger.getVertices(edges);
      verticesLists.add(vertices);
    }
    return verticesLists;
  }
Use the logic in LineageLogger to get vertices from Hook Contexts
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java