Program: 135269
Project: 135269
Buggy source:
@Test public void panelRenameTest(){
  Random rand=new Random();
  UI ui=TestController.getUI();
  PanelControl panels=ui.getPanelControl();
  pushKeys(MAXIMIZE_WINDOW);
  sleep(EVENT_DELAY);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(0)));
  sleep(EVENT_DELAY);
  type("String_Node_Str");
  push(KeyCode.ESCAPE);
  FilterPanel panel0=(FilterPanel)panels.getPanel(0);
  Text panelNameText0=panel0.getNameText();
  assertEquals("String_Node_Str",panelNameText0.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(1)));
  sleep(EVENT_DELAY);
  type("String_Node_Str");
  push(KeyCode.ENTER);
  FilterPanel panel1=(FilterPanel)panels.getPanel(1);
  Text panelNameText1=panel1.getNameText();
  assertEquals("String_Node_Str",panelNameText1.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(2)));
  sleep(EVENT_DELAY);
  push(KeyCode.BACK_SPACE);
  push(KeyCode.ENTER);
  FilterPanel panel2=(FilterPanel)panels.getPanel(2);
  Text panelNameText2=panel2.getNameText();
  assertEquals("String_Node_Str",panelNameText2.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(3)));
  sleep(EVENT_DELAY);
  String randomName3=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 1);
  PanelNameTextField renameTextField3=find("String_Node_Str");
  renameTextField3.setText(randomName3);
  push(KeyCode.ENTER);
  FilterPanel panel3=(FilterPanel)panels.getPanel(3);
  Text panelNameText3=panel3.getNameText();
  assertEquals(randomName3,panelNameText3.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(4)));
  sleep(EVENT_DELAY);
  String randomName4=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH);
  PanelNameTextField renameTextField4=find("String_Node_Str");
  renameTextField4.setText(randomName4);
  push(KeyCode.ENTER);
  FilterPanel panel4=(FilterPanel)panels.getPanel(4);
  Text panelNameText4=panel4.getNameText();
  assertEquals(randomName4,panelNameText4.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(5)));
  sleep(EVENT_DELAY);
  String randomName5=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH + 1);
  PanelNameTextField renameTextField5=find("String_Node_Str");
  renameTextField5.setText(randomName5);
  push(KeyCode.ENTER);
  FilterPanel panel5=(FilterPanel)panels.getPanel(5);
  Text panelNameText5=panel5.getNameText();
  assertEquals("String_Node_Str",panelNameText5.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(6)));
  sleep(EVENT_DELAY);
  String randomName6=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH);
  PanelNameTextField renameTextField6=find("String_Node_Str");
  renameTextField6.setText(randomName6);
  int randomCaret6=rand.nextInt(PANEL_MAX_NAME_LENGTH - 1);
  renameTextField6.positionCaret(randomCaret6);
  type("String_Node_Str");
  push(KeyCode.ENTER);
  FilterPanel panel6=(FilterPanel)panels.getPanel(6);
  Text panelNameText6=panel6.getNameText();
  assertEquals(randomName6,panelNameText6.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(7)));
  sleep(EVENT_DELAY);
  String randomName7=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 4);
  PanelNameTextField renameTextField7=find("String_Node_Str");
  renameTextField7.setText(randomName7);
  int randomCaret7=rand.nextInt(randomName7.length());
  renameTextField7.positionCaret(randomCaret7);
  String randomString=RandomStringUtils.randomAlphanumeric(5);
  type(randomString);
  push(KeyCode.ENTER);
  String expected=(randomName7.substring(0,randomCaret7) + randomString.substring(0,4) + randomName7.substring(randomCaret7,randomName7.length()));
  FilterPanel panel7=(FilterPanel)panels.getPanel(7);
  Text panelNameText7=panel7.getNameText();
  assertEquals(expected,panelNameText7.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.waitOnFxThread();
  boolean isPresentBeforeEdit=exists("String_Node_Str");
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(8)));
  PlatformEx.waitOnFxThread();
  boolean isPresentDuringEdit=true;
  try {
    exists("String_Node_Str");
  }
 catch (  NoNodesFoundException e) {
    isPresentDuringEdit=false;
  }
  String randomName8=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 1);
  PanelNameTextField renameTextField8=find("String_Node_Str");
  renameTextField8.setText(randomName8);
  push(KeyCode.ENTER);
  boolean isPresentAfterEdit=exists("String_Node_Str");
  Text panelNameText8=find("String_Node_Str");
  assertEquals(true,isPresentBeforeEdit);
  assertEquals(false,isPresentDuringEdit);
  assertEquals(true,isPresentAfterEdit);
  assertEquals(randomName8,panelNameText8.getText());
  PlatformEx.waitOnFxThread();
  click("String_Node_Str");
  push(KeyCode.DOWN).push(KeyCode.DOWN).push(KeyCode.ENTER);
  sleep(EVENT_DELAY);
}

Fixed version (ground truth):
@Test public void panelRenameTest(){
  Random rand=new Random();
  UI ui=TestController.getUI();
  PanelControl panels=ui.getPanelControl();
  pushKeys(MAXIMIZE_WINDOW);
  sleep(EVENT_DELAY);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(0)));
  sleep(EVENT_DELAY);
  type("String_Node_Str");
  push(KeyCode.ESCAPE);
  FilterPanel panel0=(FilterPanel)panels.getPanel(0);
  Text panelNameText0=panel0.getNameText();
  assertEquals("String_Node_Str",panelNameText0.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(1)));
  sleep(EVENT_DELAY);
  type("String_Node_Str");
  push(KeyCode.ENTER);
  FilterPanel panel1=(FilterPanel)panels.getPanel(1);
  Text panelNameText1=panel1.getNameText();
  assertEquals("String_Node_Str",panelNameText1.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(2)));
  sleep(EVENT_DELAY);
  push(KeyCode.BACK_SPACE);
  push(KeyCode.ENTER);
  FilterPanel panel2=(FilterPanel)panels.getPanel(2);
  Text panelNameText2=panel2.getNameText();
  assertEquals("String_Node_Str",panelNameText2.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(3)));
  sleep(EVENT_DELAY);
  String randomName3=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 1);
  PanelNameTextField renameTextField3=find("String_Node_Str");
  renameTextField3.setText(randomName3);
  push(KeyCode.ENTER);
  FilterPanel panel3=(FilterPanel)panels.getPanel(3);
  Text panelNameText3=panel3.getNameText();
  assertEquals(randomName3,panelNameText3.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(4)));
  sleep(EVENT_DELAY);
  String randomName4=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH);
  PanelNameTextField renameTextField4=find("String_Node_Str");
  renameTextField4.setText(randomName4);
  push(KeyCode.ENTER);
  FilterPanel panel4=(FilterPanel)panels.getPanel(4);
  Text panelNameText4=panel4.getNameText();
  assertEquals(randomName4,panelNameText4.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(5)));
  sleep(EVENT_DELAY);
  String randomName5=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH + 1);
  PanelNameTextField renameTextField5=find("String_Node_Str");
  renameTextField5.setText(randomName5);
  push(KeyCode.ENTER);
  FilterPanel panel5=(FilterPanel)panels.getPanel(5);
  Text panelNameText5=panel5.getNameText();
  assertEquals("String_Node_Str",panelNameText5.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(6)));
  sleep(EVENT_DELAY);
  String randomName6=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH);
  PanelNameTextField renameTextField6=find("String_Node_Str");
  renameTextField6.setText(randomName6);
  int randomCaret6=rand.nextInt(PANEL_MAX_NAME_LENGTH - 1);
  renameTextField6.positionCaret(randomCaret6);
  type("String_Node_Str");
  push(KeyCode.ENTER);
  FilterPanel panel6=(FilterPanel)panels.getPanel(6);
  Text panelNameText6=panel6.getNameText();
  assertEquals(randomName6,panelNameText6.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(7)));
  sleep(EVENT_DELAY);
  String randomName7=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 4);
  PanelNameTextField renameTextField7=find("String_Node_Str");
  renameTextField7.setText(randomName7);
  int randomCaret7=rand.nextInt(randomName7.length());
  renameTextField7.positionCaret(randomCaret7);
  String randomString=RandomStringUtils.randomAlphanumeric(5);
  type(randomString);
  push(KeyCode.ENTER);
  String expected=(randomName7.substring(0,randomCaret7) + randomString.substring(0,4) + randomName7.substring(randomCaret7,randomName7.length()));
  FilterPanel panel7=(FilterPanel)panels.getPanel(7);
  Text panelNameText7=panel7.getNameText();
  assertEquals(expected,panelNameText7.getText());
  sleep(EVENT_DELAY);
  pushKeys(CREATE_RIGHT_PANEL);
  waitUntilNodeAppears("String_Node_Str");
  boolean isPresentBeforeEdit=exists("String_Node_Str");
  PlatformEx.runAndWait(() -> UI.events.triggerEvent(new ShowRenamePanelEvent(8)));
  PlatformEx.waitOnFxThread();
  boolean isPresentDuringEdit=true;
  try {
    exists("String_Node_Str");
  }
 catch (  NoNodesFoundException e) {
    isPresentDuringEdit=false;
  }
  String randomName8=RandomStringUtils.randomAlphanumeric(PANEL_MAX_NAME_LENGTH - 1);
  PanelNameTextField renameTextField8=find("String_Node_Str");
  renameTextField8.setText(randomName8);
  push(KeyCode.ENTER);
  boolean isPresentAfterEdit=exists("String_Node_Str");
  Text panelNameText8=find("String_Node_Str");
  assertEquals(true,isPresentBeforeEdit);
  assertEquals(false,isPresentDuringEdit);
  assertEquals(true,isPresentAfterEdit);
  assertEquals(randomName8,panelNameText8.getText());
  PlatformEx.waitOnFxThread();
  click("String_Node_Str");
  push(KeyCode.DOWN).push(KeyCode.DOWN).push(KeyCode.ENTER);
  sleep(EVENT_DELAY);
}