@Test
public void encodes_and_decodes_all_events() throws Exception {
SpyListener<T> spy = new SpyListener<>(interfaceType);
exampleUsage(spy.getListener());
spy.replay();
IpcBuffer buffer = TestUtil.newIpcBuffer();
// encode
IpcProtocol<T> protocol = newIpcProtocol(buffer);
protocol.start();
exampleUsage(sendTo(protocol));
protocol.close();
// decode
buffer.position(0);
IpcReaders.decodeAll(protocol, spy.getListener());
spy.verify();
}