public void graph(String filename, Injector demoInjector) throws IOException {
        PrintWriter out = new PrintWriter(filename, StandardCharsets.UTF_8.name());

        Injector injector = Guice.createInjector(new GraphvizModule());
        GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
        grapher.setOut(out);
        grapher.setRankdir("TB");
        grapher.graph(demoInjector);
    }
copy https://github.com/google/guice/wiki/Grapher
agent-module/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/graph/Grapher.java