Program: 63138
Project: 63138
Buggy source:
@Test public void testDictionary(){
  int n=100;
  Set<BigDecimal> set=Sets.newHashSet();
  NumberDictionaryBuilder<String> builder=new NumberDictionaryBuilder<String>(new StringBytesConverter());
  for (int i=0; i < n; i++) {
    String num=randNumber();
    builder.addValue(num);
    set.add(new BigDecimal(num));
  }
  List<BigDecimal> sorted=Lists.newArrayList();
  sorted.addAll(set);
  Collections.sort(sorted);
  NumberDictionary<String> dict=builder.build(0);
  for (int i=0; i < sorted.size(); i++) {
    String dictNum=dict.getValueFromId(i);
    System.out.println(sorted.get(i) + "String_Node_Str" + dictNum);
  }
  for (int i=0; i < sorted.size(); i++) {
    String dictNum=dict.getValueFromId(i);
    assertEquals(sorted.get(i),new BigDecimal(dictNum));
  }
  for (int i=0; i < n; i++) {
    String randStr=randNumber();
    BigDecimal rand=new BigDecimal(randStr);
    int binarySearch=Collections.binarySearch(sorted,rand);
    if (binarySearch >= 0)     continue;
    int insertion=-(binarySearch + 1);
    int expectedLowerId=insertion - 1;
    int expectedHigherId=insertion;
    if (expectedLowerId < 0) {
      try {
        dict.getIdFromValue(randStr,-1);
        fail();
      }
 catch (      IllegalArgumentException ex) {
      }
    }
 else {
      assertEquals(expectedLowerId,dict.getIdFromValue(randStr,-1));
    }
    if (expectedHigherId >= sorted.size()) {
      try {
        dict.getIdFromValue(randStr,1);
        fail();
      }
 catch (      IllegalArgumentException ex) {
      }
    }
 else {
      assertEquals(expectedHigherId,dict.getIdFromValue(randStr,1));
    }
  }
}

Fixed version (ground truth):
@Test public void testDictionary(){
  int n=100;
  Set<BigDecimal> set=Sets.newHashSet();
  NumberDictionaryBuilder<String> builder=new NumberDictionaryBuilder<String>(new StringBytesConverter());
  for (int i=0; i < n; i++) {
    String num=randNumber();
    if (set.add(new BigDecimal(num))) {
      builder.addValue(num);
    }
  }
  List<BigDecimal> sorted=Lists.newArrayList();
  sorted.addAll(set);
  Collections.sort(sorted);
  NumberDictionary<String> dict=builder.build(0);
  for (int i=0; i < sorted.size(); i++) {
    String dictNum=dict.getValueFromId(i);
    System.out.println(sorted.get(i) + "String_Node_Str" + dictNum);
  }
  for (int i=0; i < sorted.size(); i++) {
    String dictNum=dict.getValueFromId(i);
    assertEquals(sorted.get(i),new BigDecimal(dictNum));
  }
  for (int i=0; i < n; i++) {
    String randStr=randNumber();
    BigDecimal rand=new BigDecimal(randStr);
    int binarySearch=Collections.binarySearch(sorted,rand);
    if (binarySearch >= 0)     continue;
    int insertion=-(binarySearch + 1);
    int expectedLowerId=insertion - 1;
    int expectedHigherId=insertion;
    if (expectedLowerId < 0) {
      try {
        dict.getIdFromValue(randStr,-1);
        fail();
      }
 catch (      IllegalArgumentException ex) {
      }
    }
 else {
      assertEquals(expectedLowerId,dict.getIdFromValue(randStr,-1));
    }
    if (expectedHigherId >= sorted.size()) {
      try {
        dict.getIdFromValue(randStr,1);
        fail();
      }
 catch (      IllegalArgumentException ex) {
      }
    }
 else {
      assertEquals(expectedHigherId,dict.getIdFromValue(randStr,1));
    }
  }
}