### Question:
MethodSignature implements Serializable { public Method toMethod(Class<?> type) { final Pair<String, Class<?>[]> info = parse(internal); return MethodUtils.getAccessibleMethod(type, info.getLeft(), info.getRight()); } MethodSignature(Method method); Method toMethod(Class<?> type); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testToMethod() throws Exception { final MethodSignature sig = new MethodSignature(Echo.class.getMethod("echoBack", String.class)); assertMethodIs(sig.toMethod(Echo.class), Echo.class, "echoBack", String.class); assertMethodIs(sig.toMethod(AbstractEcho.class), AbstractEcho.class, "echoBack", String.class); assertMethodIs(sig.toMethod(EchoImpl.class), AbstractEcho.class, "echoBack", String.class); assertMethodIs(sig.toMethod(DuplicateEcho.class), DuplicateEcho.class, "echoBack", String.class); }