CurrentDcDelayPingActionCollector extends AbstractDelayPingActionCollector implements DelayPingActionCollector, BiDirectionSupport { @Override public boolean supportInstance(RedisHealthCheckInstance instance) { return currentDcId.equalsIgnoreCase(instance.getRedisInstanceInfo().getDcId()); }  @Override boolean supportInstance(RedisHealthCheckInstance instance);  }
@Test public void testSupportInstance() { Mockito.when(instance.getRedisInstanceInfo()).thenReturn(currentMaster); Assert.assertTrue(collector.supportInstance(instance)); Mockito.when(instance.getRedisInstanceInfo()).thenReturn(remoteMaster); Assert.assertFalse(collector.supportInstance(instance)); }