BooleanActions { @CheckResult @NonNull public static Action1<? super Boolean> not(@NonNull final Action1<? super Boolean> a1) { return new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { a1.call(Boolean.FALSE.equals(aBoolean)); } }; } private  BooleanActions(); @CheckResult @NonNull static Action1<? super Boolean> not(@NonNull final Action1<? super Boolean> a1);  }
@Test public void testNot() { Action1<? super Boolean> action1 = Mockito.mock(Action1.class); Action1<? super Boolean> action2 = BooleanActions.not(action1); action2.call(true); Mockito.verify(action1).call(false); action2.call(false); Mockito.verify(action1).call(true); }