HealthCheck implements HealthStatusChecker { public void setMaxSize(int maxSize) { if (maxSize <= hardMax) this.maxSize = maxSize; } @Autowired  HealthCheck(HealthChecker healthChecker, @Value("${health.check.error.list.size:25}") int maxSize,
            @Value("${health.check.max.error.list.size:2500}") int hardMax, EventBus errorBus); @PostConstruct void register(); void setMaxSize(int maxSize); @Subscribe void onEvent(final ErrorEvent event); HealthStatus checkHealthStatus(); @Override boolean isOk();  }
@Test public void testSetMaxSizeOk() { check.setMaxSize(15); assertThat(check.getMaxSize(), is(15)); }
@Test public void testSetMaxSizeTooBig() { check.setMaxSize(100); assertThat(check.getMaxSize(), is(10)); }