diff --git a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java index 09080fed4..667703516 100644 --- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java +++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java @@ -33,6 +33,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.function.Function; import org.easymock.EasyMock; import org.junit.jupiter.api.Test; @@ -136,8 +137,7 @@ public class EventListenerSupportTest { @Test public void testSerialization() throws IOException, ClassNotFoundException, PropertyVetoException { final EventListenerSupport listenerSupport = EventListenerSupport.create(VetoableChangeListener.class); - listenerSupport.addListener(e -> { - }); + listenerSupport.addListener(Function.identity()::apply); listenerSupport.addListener(EasyMock.createNiceMock(VetoableChangeListener.class)); //serialize: