Program: 166966
Project: 166966
Buggy source:
private boolean unoptimizableChooseStep(List<Step> steps,int index){
  List<Step> toCome=steps.subList(index,steps.size());
  Step step=toCome.get(0);
  Preconditions.checkState(step instanceof ChooseStep,"String_Node_Str" + step.getClass().getSimpleName() + "String_Node_Str");
  ChooseStep chooseStep=(ChooseStep)step;
  List<Traversal.Admin<?,?>> traversalAdmins=chooseStep.getGlobalChildren();
  Preconditions.checkState(traversalAdmins.size() == 2);
  Traversal.Admin<?,?> predicate=(Traversal.Admin<?,?>)chooseStep.getLocalChildren().get(0);
  List<Step> predicateSteps=new ArrayList<>(predicate.getSteps());
  predicateSteps.remove(predicate.getSteps().size() - 1);
  Traversal.Admin<?,?> globalChildOne=(Traversal.Admin<?,?>)chooseStep.getGlobalChildren().get(0);
  List<Step> globalChildOneSteps=new ArrayList<>(globalChildOne.getSteps());
  globalChildOneSteps.remove(globalChildOneSteps.size() - 1);
  Traversal.Admin<?,?> globalChildTwo=(Traversal.Admin<?,?>)chooseStep.getGlobalChildren().get(1);
  List<Step> globalChildTwoSteps=new ArrayList<>(globalChildTwo.getSteps());
  globalChildTwoSteps.remove(globalChildTwoSteps.size() - 1);
  boolean hasIdentity=globalChildOne.getSteps().stream().anyMatch(s -> s instanceof IdentityStep);
  if (!hasIdentity) {
    hasIdentity=globalChildTwo.getSteps().stream().anyMatch(s -> s instanceof IdentityStep);
    if (hasIdentity) {
      if (!predicateSteps.equals(globalChildOneSteps)) {
        return true;
      }
    }
 else {
      return true;
    }
  }
 else {
    if (!predicateSteps.equals(globalChildTwoSteps)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean unoptimizableChooseStep(List<Step> steps,int index){
  List<Step> toCome=steps.subList(index,steps.size());
  Step step=toCome.get(0);
  Preconditions.checkState(step instanceof ChooseStep,"String_Node_Str" + step.getClass().getSimpleName() + "String_Node_Str");
  ChooseStep chooseStep=(ChooseStep)step;
  List<Traversal.Admin<?,?>> traversalAdmins=chooseStep.getGlobalChildren();
  if (traversalAdmins.size() != 2) {
    return true;
  }
  Traversal.Admin<?,?> predicate=(Traversal.Admin<?,?>)chooseStep.getLocalChildren().get(0);
  List<Step> predicateSteps=new ArrayList<>(predicate.getSteps());
  predicateSteps.remove(predicate.getSteps().size() - 1);
  Traversal.Admin<?,?> globalChildOne=(Traversal.Admin<?,?>)chooseStep.getGlobalChildren().get(0);
  List<Step> globalChildOneSteps=new ArrayList<>(globalChildOne.getSteps());
  globalChildOneSteps.remove(globalChildOneSteps.size() - 1);
  Traversal.Admin<?,?> globalChildTwo=(Traversal.Admin<?,?>)chooseStep.getGlobalChildren().get(1);
  List<Step> globalChildTwoSteps=new ArrayList<>(globalChildTwo.getSteps());
  globalChildTwoSteps.remove(globalChildTwoSteps.size() - 1);
  boolean hasIdentity=globalChildOne.getSteps().stream().anyMatch(s -> s instanceof IdentityStep);
  if (!hasIdentity) {
    hasIdentity=globalChildTwo.getSteps().stream().anyMatch(s -> s instanceof IdentityStep);
    if (hasIdentity) {
      if (!predicateSteps.equals(globalChildOneSteps)) {
        return true;
      }
    }
 else {
      return true;
    }
  }
 else {
    if (!predicateSteps.equals(globalChildTwoSteps)) {
      return true;
    }
  }
  return false;
}