core/src/test/java/com/google/errorprone/bugpatterns/CheckReturnValueTest.java
@Test
  public void testJavaLangVoidReturningMethodInAnnotatedPackage() {
    compilationHelper
        .addSourceLines(
            "package-info.java",
            "@com.google.errorprone.annotations.CheckReturnValue",
            "package lib;")
        .addSourceLines(
            "lib/Lib.java",
            "package lib;",
            "public class Lib {",
            "  public static Void f() {",
            "    return null;",
            "  }",
            "}")
        .addSourceLines(
            "Test.java", //
            "class Test {",
            "  void m() {",
            "    lib.Lib.f();",
            "  }",
            "}")
        .doTest();
  }
// Don't match Void-returning methods in packages with @CRV
Don't match Void-returning methods in packages with @CRV
Don ' t match Void - returning methods in packages with @CRV
@Test
  public void testJavaLangVoidReturningMethodInAnnotatedPackage() {
    compilationHelper
        .addSourceLines(
            "package-info.java",
            "@com.google.errorprone.annotations.CheckReturnValue",
            "package lib;")
        .addSourceLines(
            "lib/Lib.java",
            "package lib;",
            "public class Lib {",
            "  public static Void f() {",
            "    return null;",
            "  }",
            "}")
        .addSourceLines(
            "Test.java", 
            "class Test {",
            "  void m() {",
            "    lib.Lib.f();",
            "  }",
            "}")
        .doTest();
  }
@ Test public void testJavaLangVoidReturningMethodInAnnotatedPackage ( ) { compilationHelper . addSourceLines ( "package-info.java" , "@com.google.errorprone.annotations.CheckReturnValue" , "package lib;" ) . addSourceLines ( "lib/Lib.java" , "package lib;" , "public class Lib {" , "  public static Void f() {" , "    return null;" , "  }" , "}" ) . addSourceLines ( "Test.java" , "class Test {" , "  void m() {" , "    lib.Lib.f();" , "  }" , "}" ) . doTest ( ) ; }
Don't match Void-returning methods in packages with @CRV
Don ' t match Void - returning methods in packages with @CRV
//