@Test
public void failIfRedWhenGreen() throws Exception {

    try {
        new SimpleNullfree(
            new SimpleSources(
                Collections.singletonList(
                    new JavaSourceFile(
                        "class B {\n",
                        "  void a() {\n",
                        "    String foo = \"bar\";",
                        "  }\n",
                        "}\n"
                    )
                )
            ),
            SimpleBadge::new
        ).badge().failIfRed();
        // green
    } catch (NullfreeException e) {
        Assert.fail();
    }
}