Program: 32874
Project: 32874
Buggy source:
@Test public void test_replace_edge_definition() throws ArangoException {
  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(this.graphName,this.createEdgeDefinitions(2,0),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(this.graphName,edgeDefinition1);
  assertThat(driver.graphGetEdgeCollections(this.graphName).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).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 graph=driver.graphReplaceEdgeDefinition(this.graphName,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions=graph.getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions) {
    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(this.graphName).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(toCollectionName2),is(true));
}

Fixed version (ground truth):
@Test public void test_replace_edge_definition() throws ArangoException {
  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(this.graphName,this.createEdgeDefinitions(2,0),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(this.graphName,edgeDefinition1);
  assertThat(driver.graphGetEdgeCollections(this.graphName).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).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 graph=driver.graphReplaceEdgeDefinition(this.graphName,edgeCollectionName,edgeDefinition2);
  List<EdgeDefinitionEntity> edgeDefinitions=graph.getEdgeDefinitionsEntity().getEdgeDefinitions();
  for (  EdgeDefinitionEntity edgeDef : edgeDefinitions) {
    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(this.graphName).contains(edgeCollectionName),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(toCollectionName1),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(fromCollectionName2),is(true));
  assertThat(driver.graphGetVertexCollections(this.graphName).contains(toCollectionName2),is(true));
}