### Question:
B2BService { public int dummyCustomerApi(Tenant tenant) { var tenantName = tenant.getName(); var count = callsCount.getCount(tenantName); LOGGER.debug("Counter for {} : {} ", tenant.getName(), count); if (count >= tenant.getAllowedCallsPerSecond()) { LOGGER.error("API access per second limit reached for: {}", tenantName); return -1; } callsCount.incrementCount(tenantName); return getRandomCustomerId(); } B2BService(Throttler timer, CallsCount callsCount); int dummyCustomerApi(Tenant tenant);  }### Answer:
@Test public void dummyCustomerApiTest() { var tenant = new Tenant("testTenant", 2, callsCount); var timer = (Throttler) () -> { }; var service = new B2BService(timer, callsCount); IntStream.range(0, 5).mapToObj(i -> tenant).forEach(service::dummyCustomerApi); var counter = callsCount.getCount(tenant.getName()); assertEquals(2, counter, "Counter limit must be reached"); }