Program: 69918
Project: 69918
Buggy source:
@Ignore @Test @RunAsClient public void checkCreateSubcategory() throws URISyntaxException, IOException {
  RepositoryEntryVO[] wikiVO=new RepositoryEntryVO[COURSES];
  for (int i=0; i < COURSES; i++) {
    wikiVO[i]=functionalVOUtil.importWiki(deploymentUrl);
  }
  CourseVO[] courseVO=new CourseVO[COURSES];
  for (int i=0; i < COURSES; i++) {
    courseVO[i]=functionalVOUtil.importEmptyCourse(deploymentUrl);
  }
  for (int i=0; i < SUBCATEGORY_PATHS.length; i++) {
    String currentPath=SUBCATEGORY_PATHS[i];
    String currentName=currentPath.substring(currentPath.lastIndexOf('/') + 1);
    String currentDescription=SUBCATEGORY_DESCRIPTIONS[i];
    Assert.assertTrue(functionalRepositorySiteUtil.createCatalogSubcategory(browser,currentPath,currentName,currentDescription));
  }
  for (int i=0; i < COURSES; i++) {
    Assert.assertTrue(functionalRepositorySiteUtil.openCourse(browser,courseVO[i].getRepoEntryKey()));
    Assert.assertTrue(functionalCourseUtil.openCourseEditor(browser));
    String currentPath=SUBCATEGORY_PATHS[i];
    String currentName=currentPath.substring(currentPath.lastIndexOf('/') + 1);
    Assert.assertTrue(functionalCourseUtil.createWiki(browser,currentName + "String_Node_Str","String_Node_Str" + currentName + "String_Node_Str"));
    Assert.assertTrue(functionalCourseUtil.chooseWiki(browser,wikiVO[i].getKey()));
    Assert.assertTrue(functionalCourseUtil.publishEntireCourse(browser,null,SUBCATEGORY_PATHS[i]));
    Assert.assertTrue(functionalCourseUtil.closeActiveTab(browser));
  }
  Assert.assertTrue(functionalUtil.openSite(browser,FunctionalUtil.OlatSite.LEARNING_RESOURCES));
  Assert.assertTrue(functionalRepositorySiteUtil.openActionByMenuTree(browser,RepositorySiteAction.CATALOG));
  for (int i=0; i < COURSES; i++) {
    String[] selectors=functionalRepositorySiteUtil.createCatalogSelectors(SUBCATECORY_PATHS_INCLUDING_RESOURCE[i]);
    for (    String currentSelector : selectors) {
      StringBuffer selectorBuffer=new StringBuffer();
      selectorBuffer.append("String_Node_Str").append(functionalRepositorySiteUtil.getCourseModuleIconCss()).append("String_Node_Str");
      browser.click(selectorBuffer.toString());
      functionalUtil.waitForPageToLoad(browser);
      String businessPath0=functionalUtil.currentBusinessPath(browser);
      functionalRepositorySiteUtil.openCourse(browser,courseVO[i].getRepoEntryKey());
      String businessPath1=functionalUtil.currentBusinessPath(browser);
      Assert.assertEquals(businessPath1,businessPath0);
    }
  }
}

Fixed version (ground truth):
@Ignore @Test @RunAsClient public void checkCreateSubcategory() throws URISyntaxException, IOException {
  RepositoryEntryVO[] wikiVO=new RepositoryEntryVO[COURSES];
  for (int i=0; i < COURSES; i++) {
    wikiVO[i]=functionalVOUtil.importWiki(deploymentUrl);
  }
  CourseVO[] courseVO=new CourseVO[COURSES];
  for (int i=0; i < COURSES; i++) {
    courseVO[i]=functionalVOUtil.importEmptyCourse(deploymentUrl);
  }
  functionalUtil.login(browser);
  for (int i=0; i < SUBCATEGORY_PATHS.length; i++) {
    String currentPath=SUBCATEGORY_PATHS[i];
    String currentName=currentPath.substring(currentPath.lastIndexOf('/') + 1);
    String currentDescription=SUBCATEGORY_DESCRIPTIONS[i];
    Assert.assertTrue(functionalRepositorySiteUtil.createCatalogSubcategory(browser,currentPath.substring(0,currentPath.lastIndexOf('/')),currentName,currentDescription));
  }
  for (int i=0; i < COURSES; i++) {
    Assert.assertTrue(functionalRepositorySiteUtil.openCourse(browser,courseVO[i].getRepoEntryKey()));
    Assert.assertTrue(functionalCourseUtil.openCourseEditor(browser));
    String currentPath=SUBCATEGORY_PATHS[i];
    String currentName=currentPath.substring(currentPath.lastIndexOf('/') + 1);
    Assert.assertTrue(functionalCourseUtil.createCourseNode(browser,CourseNodeAlias.WIKI,"String_Node_Str",currentName + "String_Node_Str","String_Node_Str" + currentName + "String_Node_Str",0));
    Assert.assertTrue(functionalCourseUtil.chooseWiki(browser,wikiVO[i].getKey()));
    Assert.assertTrue(functionalCourseUtil.publishEntireCourse(browser,null,SUBCATEGORY_PATHS[i]));
    Assert.assertTrue(functionalCourseUtil.closeActiveTab(browser));
  }
  Assert.assertTrue(functionalUtil.openSite(browser,FunctionalUtil.OlatSite.LEARNING_RESOURCES));
  Assert.assertTrue(functionalRepositorySiteUtil.openActionByMenuTree(browser,RepositorySiteAction.CATALOG));
  for (int i=0; i < COURSES; i++) {
    String[] selectors=functionalRepositorySiteUtil.createCatalogSelectors(SUBCATECORY_PATHS_INCLUDING_RESOURCE[i]);
    for (    String currentSelector : selectors) {
      StringBuffer selectorBuffer=new StringBuffer();
      selectorBuffer.append("String_Node_Str").append(functionalRepositorySiteUtil.getCourseModuleIconCss()).append("String_Node_Str");
      browser.click(selectorBuffer.toString());
      functionalUtil.waitForPageToLoad(browser);
      String businessPath0=functionalUtil.currentBusinessPath(browser);
      functionalRepositorySiteUtil.openCourse(browser,courseVO[i].getRepoEntryKey());
      String businessPath1=functionalUtil.currentBusinessPath(browser);
      Assert.assertEquals(businessPath1,businessPath0);
    }
  }
}