diff --git a/lucene/core/src/java/org/apache/lucene/util/fst/Util.java b/lucene/core/src/java/org/apache/lucene/util/fst/Util.java
index 4f37e447c7d..e92e9b715f6 100644
--- a/lucene/core/src/java/org/apache/lucene/util/fst/Util.java
+++ b/lucene/core/src/java/org/apache/lucene/util/fst/Util.java
@@ -532,10 +532,10 @@ public final class Util {
* Dumps an {@link FST} to a GraphViz's dot
language description
* for visualization. Example of use:
*
- *
- * PrintStream ps = new PrintStream("out.dot"); - * fst.toDot(ps); - * ps.close(); + *+ * PrintWriter pw = new PrintWriter("out.dot"); + * Util.toDot(fst, pw, true, true); + * pw.close(); ** * and then, from command line: