@Test
  public void failsOnSecondAttempt() {
    Result result = TestRunner.runTest(FailsOnSecondAttempt.class);

    assertThat(result.wasSuccessful()).isFalse();

    List<Failure> failures = result.getFailures();
    assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);

    Failure failure = failures.get(0);
    assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class)
        .hasMessage(FailsOnSecondAttempt.message);
    assertThat(FailsOnSecondAttempt.count).isEqualTo(2);
  }
Unit tests for {@link RetryRule} involving local scope (ie rule affects only the test methods
annotated with {@code @Retry}) with failures due to an {@code Error}.
geode-junit/src/test/java/org/apache/geode/test/junit/rules/RetryRuleLocalWithErrorTest.java