@Test
public void testProxy() throws IgniteCheckedException {

    OptimizedMarshaller marsh = marshaller();
    marsh.setRequireSerializable(false);
    SomeItf inItf = (SomeItf)Proxy.newProxyInstance(
        OptimizedMarshallerTest.class.getClassLoader(), new Class[] {SomeItf.class},
        new InvocationHandler() {
            private NonSerializable obj = new NonSerializable(null);
            @Override public Object invoke(Object proxy, Method mtd, Object[] args) throws Throwable {
                obj.checkAfterUnmarshalled();
                return 17;
            }
        }
    );
    SomeItf outItf = marsh.unmarshal(marsh.marshal(inItf), null);
    assertEquals(outItf.checkAfterUnmarshalled(), 17);
}