### Question:
WarmUpController implements TrafficShapingController { @Override public boolean canPass(Node node, int acquireCount) { return canPass(node, acquireCount, false); } WarmUpController(double count, int warmUpPeriodInSec, int coldFactor);  WarmUpController(double count, int warmUpPeriodInSec); @Override boolean canPass(Node node, int acquireCount); @Override boolean canPass(Node node, int acquireCount, boolean prioritized);  }### Answer:
@Test public void testWarmUp() throws InterruptedException { WarmUpController warmupController = new WarmUpController(10, 10, 3); setCurrentMillis(System.currentTimeMillis()); Node node = mock(Node.class); when(node.passQps()).thenReturn(8d); when(node.previousPassQps()).thenReturn(1d); assertFalse(warmupController.canPass(node, 1)); when(node.passQps()).thenReturn(1d); when(node.previousPassQps()).thenReturn(1d); assertTrue(warmupController.canPass(node, 1)); when(node.previousPassQps()).thenReturn(10d); for (int i = 0; i < 100; i++) { sleep(100); warmupController.canPass(node, 1); } when(node.passQps()).thenReturn(8d); assertTrue(warmupController.canPass(node, 1)); when(node.passQps()).thenReturn(10d); assertFalse(warmupController.canPass(node, 1)); }