PaymentMethodsTableActionAlterations extends StubTableActionAlterations<PaymentMethod> { @NonNull @Override public Single<PaymentMethod> postUpdate(@NonNull PaymentMethod oldPaymentMethod, @Nullable PaymentMethod newPaymentMethod) { return super.postUpdate(oldPaymentMethod, newPaymentMethod) .doOnSuccess(ignored -> receiptsTable.clearCache()); } PaymentMethodsTableActionAlterations(@NonNull ReceiptsTable receiptsTable); @NonNull @Override Single<PaymentMethod> postUpdate(@NonNull PaymentMethod oldPaymentMethod, @Nullable PaymentMethod newPaymentMethod); @NonNull @Override Single<PaymentMethod> postDelete(@Nullable PaymentMethod paymentMethod);  }
@Test public void postUpdate() { alterations.postUpdate(paymentMethod1, paymentMethod2) .test() .assertValue(paymentMethod2) .assertComplete() .assertNoErrors(); verify(receiptsTable).clearCache(); }