@Override @SuppressWarnings("unchecked") public <E> Stream<E> filterCandidates(T message, Stream<E> candidates) { Property routingProperty = getProperty(message.getPayloadType(), routingKey); if (routingProperty == null) { return Stream.empty(); } Object routingValue = routingProperty.getValue(message.getPayload()); return candidates.filter(candidate -> matchesInstance(candidate, routingValue)); }