class ClassVisitor {

  public static String removeParameterQualification(String _string) {
    final StringBuilder b = new StringBuilder();

    // Get everything between the brackets
    final int i = _string.indexOf("(");
    final int j = _string.lastIndexOf(")");
    if (i == -1 || j == -1)
      throw new IllegalArgumentException("Method has no round brackets: [" + _string + "]");

    b.append(_string.substring(0, i + 1));
    b.append(ClassVisitor.removePackageContext(_string.substring(i + 1, j)));
    b.append(_string.substring(j));
    return b.toString();
  }

}

class ClassVisitorTest  {

  @Test
  public void testFixQName() {

    assertTrue(ClassVisitor.removeParameterQualification("a.b.c.Class()").equals("a.b.c.Class()"));
    assertTrue(
        ClassVisitor.removeParameterQualification("a.b.c.Class(int)").equals("a.b.c.Class(int)"));
    assertTrue(
        ClassVisitor.removeParameterQualification("a.b.c.Class(int,a.b.C)")
            .equals("a.b.c.Class(int,C)"));
    assertTrue(
        ClassVisitor.removeParameterQualification("a.b.c.Class(int,C,boolean,a.b.c.ddd.Test)")
            .equals("a.b.c.Class(int,C,boolean,Test)"));
  }

}