// given
IMethods mock = mock(IMethods.class, withSettings().serializable());
CustomAnswersMustImplementSerializableForSerializationToWork answer =
new CustomAnswersMustImplementSerializableForSerializationToWork();
answer.string = "return value";
when(mock.objectArgMethod(anyString())).thenAnswer(answer);
// when
ByteArrayOutputStream serialized = serializeMock(mock);
// then