Program: 32875
Project: 32875
Buggy source:
@Test public void test_replace_edge_definition_2_graphs() throws ArangoException {
  String graphName1="String_Node_Str";
  String graphName2="String_Node_Str";
  String edgeCollectionName="String_Node_Str";
  String fromCollectionName1="String_Node_Str";
  String fromCollectionName2="String_Node_Str";
  String toCollectionName1="String_Node_Str";
  String toCollectionName2="String_Node_Str";
  driver.createGraph(graphName1,this.createEdgeDefinitions(2,0),this.createOrphanCollections(2),true);
  driver.createGraph(graphName2,this.createEdgeDefinitions(2,2),this.createOrphanCollections(2),true);
  EdgeDefinitionEntity edgeDefinition1=new EdgeDefinitionEntity();
  edgeDefinition1.setCollection(edgeCollectionName);
  List<String> from1=new ArrayList<String>();
  from1.add(fromCollectionName1);
  edgeDefinition1.setFrom(from1);
  List<String> to1=new ArrayList<String>();
  to1.add(toCollectionName1);
  edgeDefinition1.setTo(to1);
  driver.graphCreateEdgeDefinition(graphName1,edgeDefinition1);
  driver.graphCreateEdgeDefinition(graphName2,edgeDefinition1);
  assertThat(driver.graphGetEdgeCollections(graphName1).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetEdgeCollections(graphName2).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName1),is(true));
  EdgeDefinitionEntity edgeDefinition2=new EdgeDefinitionEntity();
  edgeDefinition2.setCollection(edgeCollectionName);
  List<String> from2=new ArrayList<String>();
  from2.add(fromCollectionName2);
  edgeDefinition2.setFrom(from2);
  List<String> to2=new ArrayList<String>();
  to2.add(toCollectionName2);
  edgeDefinition2.setTo(to2);
  GraphEntity graph1=driver.graphReplaceEdgeDefinition(graphName1,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions1=graph1.getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions1) {
    List<String> f=edgeDef.getFrom();
    assertThat(f.contains(from1),is(false));
    List<String> t=edgeDef.getTo();
    assertThat(t.contains(to1),is(false));
  }
  GraphEntity graph2=driver.graphReplaceEdgeDefinition(graphName1,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions2=graph2.getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions2) {
    List<String> f=edgeDef.getFrom();
    assertThat(f.contains(from1),is(false));
    List<String> t=edgeDef.getTo();
    assertThat(t.contains(to1),is(false));
  }
  assertThat(driver.graphGetEdgeCollections(graphName1).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName2),is(true));
  assertThat(driver.graphGetEdgeCollections(graphName2).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName2),is(true));
}

Fixed version (ground truth):
@Test public void test_replace_edge_definition_2_graphs() throws ArangoException {
  String graphName1="String_Node_Str";
  String graphName2="String_Node_Str";
  String edgeCollectionName="String_Node_Str";
  String fromCollectionName1="String_Node_Str";
  String fromCollectionName2="String_Node_Str";
  String toCollectionName1="String_Node_Str";
  String toCollectionName2="String_Node_Str";
  driver.createGraph(graphName1,this.createEdgeDefinitions(2,0),this.createOrphanCollections(2),true);
  driver.createGraph(graphName2,this.createEdgeDefinitions(2,2),this.createOrphanCollections(2),true);
  EdgeDefinitionEntity edgeDefinition1=new EdgeDefinitionEntity();
  edgeDefinition1.setCollection(edgeCollectionName);
  List<String> from1=new ArrayList<String>();
  from1.add(fromCollectionName1);
  edgeDefinition1.setFrom(from1);
  List<String> to1=new ArrayList<String>();
  to1.add(toCollectionName1);
  edgeDefinition1.setTo(to1);
  driver.graphCreateEdgeDefinition(graphName1,edgeDefinition1);
  driver.graphCreateEdgeDefinition(graphName2,edgeDefinition1);
  assertThat(driver.graphGetEdgeCollections(graphName1).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetEdgeCollections(graphName2).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName1),is(true));
  EdgeDefinitionEntity edgeDefinition2=new EdgeDefinitionEntity();
  edgeDefinition2.setCollection(edgeCollectionName);
  List<String> from2=new ArrayList<String>();
  from2.add(fromCollectionName2);
  edgeDefinition2.setFrom(from2);
  List<String> to2=new ArrayList<String>();
  to2.add(toCollectionName2);
  edgeDefinition2.setTo(to2);
  GraphEntity graph1=driver.graphReplaceEdgeDefinition(graphName1,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions1=graph1.getEdgeDefinitionsEntity().getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions1) {
    List<String> f=edgeDef.getFrom();
    assertThat(f.contains(from1),is(false));
    List<String> t=edgeDef.getTo();
    assertThat(t.contains(to1),is(false));
  }
  GraphEntity graph2=driver.graphReplaceEdgeDefinition(graphName1,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions2=graph2.getEdgeDefinitionsEntity().getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions2) {
    List<String> f=edgeDef.getFrom();
    assertThat(f.contains(from1),is(false));
    List<String> t=edgeDef.getTo();
    assertThat(t.contains(to1),is(false));
  }
  assertThat(driver.graphGetEdgeCollections(graphName1).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(graphName1).contains(toCollectionName2),is(true));
  assertThat(driver.graphGetEdgeCollections(graphName2).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(graphName2).contains(toCollectionName2),is(true));
}