### Question:
ReflectUtils { public static String equalSignatures(Method m1, Method m2) { StringBuilder sb = new StringBuilder(); if (!m1.getReturnType().equals(m2.getReturnType())) { sb.append(Strings.get("return_type_mismatch", m1.getReturnType(), m2.getReturnType())); sb.append(" "); } Class<?>[] types1 = m1.getParameterTypes(); Class<?>[] types2 = m2.getParameterTypes(); if (types1.length != types2.length) { sb.append(Strings.get("parameter_number_mismatch", types1.length, types2.length)); } else { for (int i = 0; i < types1.length; i++) { if (!types1[i].equals(types2[i])) { sb.append(Strings.get("parameter_type_mismatch", i, types1[i], types2[i])); sb.append(" "); } } } if (sb.length() == 0) return null; sb.append('\n').append(m1.toGenericString()); sb.append('\n').append(m2.toGenericString()); return sb.toString(); }  static String equalSignatures(Method m1, Method m2);  }### Answer:
@Test public void testEqualSignatures() throws NoSuchMethodException { Method m1 = getClass().getDeclaredMethod("met1", String.class, Long.class); Method m2 = getClass().getDeclaredMethod("met2", String.class, Long.class); Method m3 = getClass().getDeclaredMethod("met3", String.class); Method m4 = getClass().getDeclaredMethod("met4", String.class, Integer.class); Method m5 = getClass().getDeclaredMethod("met5", String.class, Integer.class); Method m6 = getClass().getDeclaredMethod("met6", String.class, String.class); String s1 = ReflectUtils.equalSignatures(m1, m2); String s2 = ReflectUtils.equalSignatures(m1, m3); String s3 = ReflectUtils.equalSignatures(m1, m4); String s4 = ReflectUtils.equalSignatures(m2, m1); String s5 = ReflectUtils.equalSignatures(m2, m3); String s6 = ReflectUtils.equalSignatures(m2, m4); String s7 = ReflectUtils.equalSignatures(m3, m4); String s8 = ReflectUtils.equalSignatures(m4, m5); String s9 = ReflectUtils.equalSignatures(m5, m6); assertNull(s1); assertNull(s4); assertNotNull(s2); assertNotNull(s3); assertNotNull(s5); assertNotNull(s6); assertNotNull(s7); assertNotNull(s8); assertNotNull(s9); System.out.println("---------SUCCESSful MISMATCH STRINGS: ------------"); System.out.printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", s2, s3, s5, s6, s7, s8, s9); System.out.println("--------------------------------------------------"); }