Reuse Function identity
This commit is contained in:
parent
47f699be39
commit
16ed9eb220
|
@ -33,6 +33,7 @@ import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.easymock.EasyMock;
|
import org.easymock.EasyMock;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -136,8 +137,7 @@ public class EventListenerSupportTest {
|
||||||
@Test
|
@Test
|
||||||
public void testSerialization() throws IOException, ClassNotFoundException, PropertyVetoException {
|
public void testSerialization() throws IOException, ClassNotFoundException, PropertyVetoException {
|
||||||
final EventListenerSupport<VetoableChangeListener> listenerSupport = EventListenerSupport.create(VetoableChangeListener.class);
|
final EventListenerSupport<VetoableChangeListener> listenerSupport = EventListenerSupport.create(VetoableChangeListener.class);
|
||||||
listenerSupport.addListener(e -> {
|
listenerSupport.addListener(Function.identity()::apply);
|
||||||
});
|
|
||||||
listenerSupport.addListener(EasyMock.createNiceMock(VetoableChangeListener.class));
|
listenerSupport.addListener(EasyMock.createNiceMock(VetoableChangeListener.class));
|
||||||
|
|
||||||
//serialize:
|
//serialize:
|
||||||
|
|
Loading…
Reference in New Issue