NodeFailer extends NodeRepositoryMaintainer { static boolean badNode(List<ServiceInstance> services) { Map<ServiceStatus, Long> countsByStatus = services.stream() .collect(Collectors.groupingBy(ServiceInstance::serviceStatus, counting())); return countsByStatus.getOrDefault(ServiceStatus.UP, 0L) <= 0L && countsByStatus.getOrDefault(ServiceStatus.DOWN, 0L) > 0L; } NodeFailer(Deployer deployer, HostLivenessTracker hostLivenessTracker,
                      ServiceMonitor serviceMonitor, NodeRepository nodeRepository,
                      Duration downTimeLimit, Duration interval, Clock clock, Orchestrator orchestrator,
                      ThrottlePolicy throttlePolicy, Metric metric); static List<String> reasonsToFailParentHost(Node hostNode);  }
@Test public void testUpness() { assertFalse(badNode(0, 0, 0)); assertFalse(badNode(0, 0, 2)); assertFalse(badNode(0, 3, 0)); assertFalse(badNode(0, 3, 2)); assertTrue(badNode(1, 0, 0)); assertTrue(badNode(1, 0, 2)); assertFalse(badNode(1, 3, 0)); assertFalse(badNode(1, 3, 2)); }