Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Avoid negation in an assertTrue or assertFalse test. For example, rephrase: assertTrue(!expr); as: assertFalse(expr);
public class SimpleTest extends TestCase {
  public void testX() {
    assertTrue("not empty", !r.isEmpty()); // violation, replace with assertFalse("not empty", r.isEmpty())
    assertFalse(!r.isEmpty()); // violation, replace with assertTrue("empty", r.isEmpty())
New to GrepCode? Check out our FAQ X