Program: 12389
Project: 12389
Buggy source:
@Test public void indexTestAll(){
  db.createIndex("String_Node_Str","String_Node_Str",null,new IndexField[]{new IndexField("String_Node_Str",SortOrder.asc),new IndexField("String_Node_Str",SortOrder.asc)});
  db.createIndex("String_Node_Str","String_Node_Str",null,new IndexField[]{new IndexField("String_Node_Str",SortOrder.asc)});
  List<Index> indices=db.listIndices();
  assertNotNull(indices);
  assert(indices.size() > 0);
  for (  Index i : indices) {
    assertNotNull(i.getName());
    assertNotNull(i.getFields());
    Iterator<IndexField> flds=i.getFields();
    assert(flds.hasNext());
    while (flds.hasNext()) {
      IndexField fld=flds.next();
      assertNotNull(fld.getName());
      assertNotNull(fld.getOrder());
    }
  }
  List<Movie> movies=db.findByIndex("String_Node_Str",Movie.class,new FindByIndexOptions().sort(new IndexField("String_Node_Str",SortOrder.desc)).fields("String_Node_Str").fields("String_Node_Str"));
  assertNotNull(movies);
  assert(movies.size() > 0);
  for (  Movie m : movies) {
    assertNotNull(m.getMovie_name());
    assertNotNull(m.getMovie_year());
  }
  movies=db.findByIndex("String_Node_Str",Movie.class,new FindByIndexOptions().sort(new IndexField("String_Node_Str",SortOrder.desc)).fields("String_Node_Str").fields("String_Node_Str").limit(1).skip(1).readQuorum(2));
  assertNotNull(movies);
  assert(movies.size() == 1);
  for (  Movie m : movies) {
    assertNotNull(m.getMovie_name());
    assertNotNull(m.getMovie_year());
  }
  db.deleteIndex("String_Node_Str","String_Node_Str");
  db.deleteIndex("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void indexTestAll(){
  db.createIndex("String_Node_Str","String_Node_Str",null,new IndexField[]{new IndexField("String_Node_Str",SortOrder.asc),new IndexField("String_Node_Str",SortOrder.asc)});
  db.createIndex("String_Node_Str","String_Node_Str",null,new IndexField[]{new IndexField("String_Node_Str",SortOrder.asc)});
  List<Index> indices=db.listIndices();
  assertNotNull(indices);
  assert(indices.size() > 0);
  for (  Index i : indices) {
    assertNotNull(i.getName());
    assertNotNull(i.getFields());
    Iterator<IndexField> flds=i.getFields();
    assert(flds.hasNext());
    while (flds.hasNext()) {
      IndexField fld=flds.next();
      assertNotNull(fld.getName());
      assertNotNull(fld.getOrder());
    }
  }
  List<Movie> movies=db.findByIndex("String_Node_Str",Movie.class,new FindByIndexOptions().sort(new IndexField("String_Node_Str",SortOrder.desc)).fields("String_Node_Str").fields("String_Node_Str"));
  assertNotNull(movies);
  assert(movies.size() > 0);
  for (  Movie m : movies) {
    assertNotNull(m.getMovie_name());
    assertNotNull(m.getMovie_year());
  }
  movies=db.findByIndex("String_Node_Str",Movie.class,new FindByIndexOptions().sort(new IndexField("String_Node_Str",SortOrder.desc)).fields("String_Node_Str").fields("String_Node_Str").limit(1).skip(1).readQuorum(2));
  assertNotNull(movies);
  assert(movies.size() == 1);
  for (  Movie m : movies) {
    assertNotNull(m.getMovie_name());
    assertNotNull(m.getMovie_year());
  }
  Map<String,Object> year=new HashMap<String,Object>();
  year.put("String_Node_Str",new Integer(1960));
  Map<String,Object> selector=new HashMap<String,Object>();
  selector.put("String_Node_Str",year);
  selector.put("String_Node_Str","String_Node_Str");
  movies=db.findByIndex(new GsonBuilder().create().toJson(selector),Movie.class,new FindByIndexOptions().sort(new IndexField("String_Node_Str",SortOrder.desc)).fields("String_Node_Str").fields("String_Node_Str").limit(1).skip(1).readQuorum(2));
  assertNotNull(movies);
  assert(movies.size() == 1);
  for (  Movie m : movies) {
    assertNotNull(m.getMovie_name());
    assertNotNull(m.getMovie_year());
  }
  db.deleteIndex("String_Node_Str","String_Node_Str");
  db.deleteIndex("String_Node_Str","String_Node_Str");
}