code: public static AssertionError expectFailure(StandardSubjectBuilderCallback assertionCallback) {
      ExpectFailure expectFailure = new ExpectFailure();
      expectFailure.enterRuleContext(); // safe since this instance doesn't leave this method
      assertionCallback.invokeAssertion(expectFailure.whenTesting());
      return expectFailure.getFailure();
    }
docs: Static alternative that directly returns the triggered failure. This is intended to be used in
  Java 8+ tests similar to {@code expectThrows()}:
  
  <p>{@code AssertionError failure = expectFailure(whenTesting ->
  whenTesting.that(4).isNotEqualTo(4));}