class HeartBeatListener implements ApplicationListener<HeartbeatEvent> {

	private static final LogAccessor LOG = new LogAccessor(LogFactory.getLog(HeartBeatListener.class));

	private final AtomicReference<List<EndpointNameAndNamespace>> lastState = new AtomicReference<>(List.of());

	HeartBeatListener(Environment environment) {
		String watchDelay = environment.getProperty(CATALOG_WATCH_PROPERTY_NAME);
		if (watchDelay != null) {
			LOG.debug("using delay : " + watchDelay);
		}
		else {
			LOG.debug("using default watch delay : " + CATALOG_WATCHER_DEFAULT_DELAY);
		}
	}

	@Override
	@SuppressWarnings("unchecked")
	public void onApplicationEvent(HeartbeatEvent event) {<FILL_FUNCTION_BODY>}

	AtomicReference<List<EndpointNameAndNamespace>> lastState() {
		return lastState;
	}

}

		LOG.debug(() -> "received heartbeat event");
		List<EndpointNameAndNamespace> state = (List<EndpointNameAndNamespace>) event.getValue();
		LOG.debug(() -> "state received : " + state);
		lastState.set(state);
	
<no_super_class>