### Question:
ZKCache { private void offlineChange(String newValue) { if (slaveOfflineFlags.equals(newValue)) return; this.setOfflineDbs(buildDBStatusByString(newValue)); DBChannelDispatcher dispatcher = DBChannelDispatcher.getHolders().get(this.groupName); dispatcher.updateDbInfo(dispatcher.getDalGroupConfig().getDbInfos()); slaveOfflineFlags = newValue; } ZKCache(String groupName); SQLPatternRejecter getSQLByPatternRejecter(); SQLRegularExpRejecter getSQLByRegularExpRejecter(); SQLRealRegularRejecter getSQLRealRegularRejecter(); void init(Properties config); void setZkCfg(String attr, String newValue); void setZKProperty(Properties _config); int getMaxResultBufSize(); double getMaxActiveDbSessions(); int getMaxQueueSize(); String getRejectSQLByPattern(); String getRejectSQLByRegularExpPattern(); int getLowerAutoKillerSize(); int getSmartLowerAutoKillerSize(); int getUpperAutoKillerSize(); int getSmartUpperAutoKillerSize(); boolean isAutoKillerOpen(); int getAutoKillerSlowSQL(); int getSmartAutoKillerSlowSQL(int queueSize); int getAutoKillerSlowCommit(); int getDelayReturnError(); long getHeartbeatFastfailPeriodEnd(); double getMaxActiveDBTrx(); String getGroupName(); Set<String> getOfflineDbs(); void setOfflineDbs(Set<String> offlineDbs); boolean isInBindMasterPeriod(); boolean isInHeartbeatFastfailPeriod(); boolean isInWeakMasterMode(); Predicate<String> getZKWhiteFieldsFilter(); Map<String, Double> getTrafficPolicings(); boolean isBindMasterSQL(String sqlHash); boolean isAppendIndexHintsSQL(String sqlHash); ZKSQLHint getAppendIndexHintsBySQLHash(String sqlHash); boolean isPureSlaveOnly();  }### Answer:
@Test public void testOfflinechange() throws Exception { ZKCache zkCache = new ZKCache("abc_test_group"); DBChannelDispatcher testDBChannelDispatcher = new DBChannelDispatcher(new DALGroup("abc_test_group", "test", "groups"), zkCache); DBChannelDispatcher.getHolders().put("abc_test_group", testDBChannelDispatcher); zkCache.setZkCfg(Constants.SLAVE_OFFLINE_FLAGS, "groups:slave1;"); assertTrue(zkCache.getOfflineDbs().contains("groups:slave1")); zkCache.setZkCfg(Constants.SLAVE_OFFLINE_FLAGS, "groups:slave2;"); assertFalse(zkCache.getOfflineDbs().contains("groups:slave1")); assertTrue(zkCache.getOfflineDbs().contains("groups:slave2")); zkCache.setZkCfg(Constants.SLAVE_OFFLINE_FLAGS, ""); assertFalse(zkCache.getOfflineDbs().contains("groups:slave1")); assertFalse(zkCache.getOfflineDbs().contains("groups:slave2")); }