@Test void testPayload() { assertTrue(Conflicts.payloadMatching(payload -> Objects.equals(payload, PAYLOAD + 2)).test(events)); assertTrue(Conflicts.payloadMatching(String.class, payload -> Objects.equals(payload, PAYLOAD + 5)).test(events)); assertFalse(Conflicts.payloadMatching(payload -> Objects.equals(payload, PAYLOAD + 11)).test(events)); }
public static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter) { return events -> events.stream().map(Message::getPayload).anyMatch(payloadFilter::test); }
Conflicts { public static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter) { return events -> events.stream().map(Message::getPayload).anyMatch(payloadFilter::test); } }
Conflicts { public static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter) { return events -> events.stream().map(Message::getPayload).anyMatch(payloadFilter::test); } private  Conflicts(); }
Conflicts { public static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter) { return events -> events.stream().map(Message::getPayload).anyMatch(payloadFilter::test); } private  Conflicts(); static Predicate<List<T>> eventMatching(
            Predicate<? super T> messageFilter); static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter); @SuppressWarnings("unchecked") static Predicate<List<DomainEventMessage<?>>> payloadMatching(Class<T> payloadType,
                                                                       Predicate<? super T>
                                                                                               payloadFilter); static Predicate<List<DomainEventMessage<?>>> payloadTypeOf(Class<T> payloadType); }
Conflicts { public static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter) { return events -> events.stream().map(Message::getPayload).anyMatch(payloadFilter::test); } private  Conflicts(); static Predicate<List<T>> eventMatching(
            Predicate<? super T> messageFilter); static Predicate<List<DomainEventMessage<?>>> payloadMatching(Predicate<Object> payloadFilter); @SuppressWarnings("unchecked") static Predicate<List<DomainEventMessage<?>>> payloadMatching(Class<T> payloadType,
                                                                       Predicate<? super T>
                                                                                               payloadFilter); static Predicate<List<DomainEventMessage<?>>> payloadTypeOf(Class<T> payloadType);  }