### Question:
WarmUpRateLimiterController extends WarmUpController { @Override public boolean canPass(Node node, int acquireCount) { return canPass(node, acquireCount, false); } WarmUpRateLimiterController(double count, int warmUpPeriodSec, int timeOutMs, int coldFactor); @Override boolean canPass(Node node, int acquireCount); @Override boolean canPass(Node node, int acquireCount, boolean prioritized);  }### Answer:
@Test public void testPace() throws InterruptedException { WarmUpRateLimiterController controller = new WarmUpRateLimiterController(10, 10, 1000, 3); Node node = mock(Node.class); when(node.passQps()).thenReturn(100d); when(node.previousPassQps()).thenReturn(100d); assertTrue(controller.canPass(node, 1)); long start = System.currentTimeMillis(); int requests = 10; for (int i = 0; i < requests; i++) { assertTrue(controller.canPass(node, 1)); } float cost = (System.currentTimeMillis() - start) / 1.0f / requests; assertTrue(Math.abs(cost - 100) < 10); }
@Test public void testPaceCanNotPass() throws InterruptedException { WarmUpRateLimiterController controller = new WarmUpRateLimiterController(10, 10, 10, 3); Node node = mock(Node.class); when(node.passQps()).thenReturn(100d); when(node.previousPassQps()).thenReturn(100d); assertTrue(controller.canPass(node, 1)); assertFalse(controller.canPass(node, 1)); }