### Question:
RequestLimiter { public RequestLimiter(double qpsAllowed) { this(new UnaryLeapArray(10, 1000), qpsAllowed); } RequestLimiter(double qpsAllowed);   RequestLimiter(LeapArray<LongAdder> data, double qpsAllowed); void increment(); void add(int x); long getSum(); double getQps(); double getQpsAllowed(); boolean canPass(); RequestLimiter setQpsAllowed(double qpsAllowed); boolean tryPass();  }### Answer:
@Test public void testRequestLimiter() { setCurrentMillis(System.currentTimeMillis()); RequestLimiter limiter = new RequestLimiter(10); limiter.add(3); limiter.add(3); limiter.add(3); assertTrue(limiter.canPass()); assertEquals(9, limiter.getSum()); limiter.add(3); assertFalse(limiter.canPass()); sleep(1000); limiter.add(3); assertTrue(limiter.tryPass()); assertTrue(limiter.canPass()); assertEquals(4, limiter.getSum()); }