Api { void run(final Consumer<T> consumer) { final Function<T, Boolean> wrapper = t -> { consumer.accept(t); return false; }; call(wrapper); } Api(final T proxy);  Api(final T proxy, final RequestCounter counter);   }
@Test void executeProcedure() { final LoanApi mock = mock(LoanApi.class); final Api<LoanApi> api = new Api<>(mock, counter); final Consumer<LoanApi> procedure = mock(Consumer.class); api.run(procedure); verify(procedure, times(1)).accept(eq(mock)); assertThat(counter.count()).isEqualTo(1); }