### Question:
MethodFormat { public String format(Method method) { String signature = method.toGenericString(); Matcher matcher = METHOD_PATTERN.matcher(signature); if (matcher.find()) { String M = matcher.group(1); String r = matcher.group(2); String qc = matcher.group(3); String m = matcher.group(4); String qa = matcher.group(5); String qe = matcher.group(6); String c = qc.replaceAll(PACKAGE_PATTERN, ""); String a = qa.replaceAll(PACKAGE_PATTERN, ""); String e = qe.replaceAll(PACKAGE_PATTERN, ""); return format.format(new Object[]{ M, r, qc, m, qa, qe, c, a, e }); } else { throw new RuntimeException("Cuke4Duke bug: Couldn't format " + signature); } } MethodFormat(String format); String format(Method method);  }### Answer:
@Test public void shouldUseSimpleFormatWhenMethodHasException() { assertEquals("MethodFormatTest.methodWithArgsAndException(String,Map)", new MethodFormat("%c.%m(%a)").format(methodWithArgsAndException)); }
@Test public void shouldUseSimpleFormatWhenMethodHasNoException() { assertEquals("MethodFormatTest.methodWithoutArgs()", new MethodFormat("%c.%m(%a)").format(methodWithoutArgs)); }