diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedMethodTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedMethodTest.java index 27e48432424..f52abd90d14 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedMethodTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedMethodTest.java @@ -253,6 +253,44 @@ public class UnusedWithComment {} .doTest(); } + @Test + public void removal_markdownJavadocs() { + refactoringHelper + .addInputLines( + "UnusedWithComment.java", + """ + package unusedvars; + + public class UnusedWithComment { + /// Method comment + private void test1() {} + + /// First line of method comment + /// Second line of method comment + private void test2() {} + + // Keep this comment + + /// First line of method comment + /// + /// Second line of method comment + private void test3() {} + } + """) + .addOutputLines( + "UnusedWithComment.java", + """ + package unusedvars; + + public class UnusedWithComment { + + // Keep this comment + + } + """) + .doTest(); + } + @Test public void usedInLambda() { helper