@Test
public void testRequireSerializable() {

    OptimizedMarshaller marsh = marshaller();
    marsh.setRequireSerializable(true);
    try {
        marsh.marshal(new NonSerializable(null));
        fail();
    }
    catch (IgniteCheckedException ignore) {
        // No-op.
    }
}