code: public static String extractClassName(Description description) {
          final String displayName = description.getDisplayName();
  
          final String regex = "^" + "[^\\(\\)]+" // non-parens
                         + "\\((" // then an open-paren (start matching a group)
                         + "[^\\\\(\\\\)]+" // non-parens
                         + ")\\)" + "$";
          // System.out.println(regex);
          final Pattern parens = Pattern.compile(regex); // then a close-paren
                                                         // (end group match)
          final Matcher m = parens.matcher(displayName);
          if (!m.find()) {
              return displayName;
          }
          return m.group(1);
      }
docs: Extract the class name from a given junit test description
  
  @param description
  @return a class name