Method method = myClass.getClass().getMethod("methodWithPrimitiveParamsAndReturningVoid", new Class[]
{byte.class, short.class, int.class, long.class, char.class, float.class, double.class, boolean.class});
SerializableMethod serializableMethod = new SerializableMethod(method, myClass.getClass());
// invoke the toMethod()
Method copyOfMethod = serializableMethod.toMethod();
// test equals
assertTrue(
"Failure - The method returned by toMethod() of SerializableMethod is not equal to the original method",
method.equals(copyOfMethod));