String (Description description) { try { return description.getMethodName(); } catch (NoSuchMethodError e) { final String displayName = description.getDisplayName(); Matcher matcher = Pattern.compile("(.*)\\((.*)\\)").matcher(displayName); if (matcher.matches()) return matcher.group(1); return null; } }