### Question:
FlowCtrlRuleHandler { public FlowCtrlRuleHandler(boolean isDefault) { this.isDefaultHandler = isDefault; if (this.isDefaultHandler) { flowCtrlName = "Default_FlowCtrl"; } else { flowCtrlName = "Group_FlowCtrl"; } } FlowCtrlRuleHandler(boolean isDefault); void updateDefFlowCtrlInfo(final int qyrPriorityId,
                                      final long flowCtrlId,
                                      final String flowCtrlInfo); FlowCtrlResult getCurDataLimit(long lastDataDlt); int getNormFreqInMs(); int getMinDataFreqInMs(); FlowCtrlItem getFilterCtrlItem(); int getMinZeroCnt(); int getCurFreqLimitTime(int msgZeroCnt, int rcmVal); int getQryPriorityId(); void setQryPriorityId(int qryPriorityId); long getFlowCtrlId(); void clear(); Map<Integer, List<FlowCtrlItem>> parseFlowCtrlInfo(final String flowCtrlInfo); @Override String toString();  }### Answer:
@Test public void testFlowCtrlRuleHandler() { try { FlowCtrlRuleHandler handler = new FlowCtrlRuleHandler(true); handler.updateDefFlowCtrlInfo(2, 10, mockFlowCtrlInfo()); TimeZone timeZone = TimeZone.getTimeZone("GMT+8:00"); Calendar rightNow = Calendar.getInstance(timeZone); int hour = rightNow.get(Calendar.HOUR_OF_DAY); int minu = rightNow.get(Calendar.MINUTE); int curTime = hour * 100 + minu; FlowCtrlResult result = handler.getCurDataLimit(2000); if (curTime >= 800 && curTime <= 1759) { assertEquals(result.dataLtInSize, 20 * 1024 * 1024L); assertEquals(1000L, result.freqLtInMs); } else if (curTime >= 1800 && curTime < 2200) { assertEquals(result.dataLtInSize, 20 * 1024 * 1024L); assertEquals(5000L, result.freqLtInMs); } else { assertNull("result should be null", result); } result = handler.getCurDataLimit(1000); assertNull("result should be null", result); FlowCtrlItem item = handler.getFilterCtrlItem(); assertEquals(item.getDataLtInSZ(), 0); assertEquals(item.getZeroCnt(), 400); assertEquals(item.getFreqLtInMs(), 100); assertEquals(handler.getNormFreqInMs(), 100); assertEquals(handler.getFlowCtrlId(), 10); assertEquals(handler.getMinDataFreqInMs(), 400); assertEquals(handler.getMinZeroCnt(), 3); assertEquals(handler.getQryPriorityId(), 2); assertEquals(handler.getFlowCtrlId(), 10); System.out.println(); System.out.println(); } catch (Exception e) { e.printStackTrace(); } }