### Question:
HealthServiceImpl extends BaseService implements HealthService, Stoppable { @Override public void register(final String name, final long ttl, final TimeUnit timeUnit) { logger.info("HealthService::register() {} {} {}", name, ttl, timeUnit); final NodeHealthStat nodeHealthStat = new NodeHealthStat(name, timeUnit.toMillis(ttl)); serviceHealthStatMap.put(name, nodeHealthStat); super.incrementCount("nodes"); super.recordLevel("nodes", serviceHealthStatMap.size()); } HealthServiceImpl(final String healthPrefix,
                             final Reactor reactor,
                             final Timer timer,
                             final StatsCollector statsCollector,
                             final long recheckInterval,
                             final TimeUnit timeUnit,
                             final List<HealthCheckJob> healthCheckJobs,
                             final Optional<Consumer<NodeHealthStat>> onFail,
                             final Optional<Consumer<NodeHealthStat>> onWarn,
                             final Optional<Consumer<NodeHealthStat>> onCheckIn); @Override void register(final String name, final long ttl, final TimeUnit timeUnit); @Override void registerNoTtl(final String name); @Override void checkInOk(final String name); @Override void checkIn(final String name, final HealthStatus status); @Override void failWithReason(final String name, final HealthFailReason reason); @Override void failWithError(final String name, final Throwable error); @Override void warnWithReason(final String name, final HealthFailReason reason); @Override void warnWithError(final String name, final Throwable error); @Override boolean ok(); @Override List<String> findHealthyNodes(); @Override List<String> findAllNodes(); @Override List<String> findAllNodesWithStatus(final HealthStatus queryStatus); @Override List<String> findNotHealthyNodes(); @Override List<NodeHealthStat> loadNodes(); @Override void unregister(String nodeName); @Override void stop();  }### Answer:
@Test public void testRegister() throws Exception { healthService.register("foo", 1, TimeUnit.SECONDS); assertTrue("foo is found", healthService.findAllNodes().stream().anyMatch(s -> s.equals("foo"))); assertTrue("foo is not found among the healthy yet", !healthService.findHealthyNodes().stream().anyMatch(s -> s.equals("foo"))); }