Program: 188767
Project: 188767
Buggy source:
@Test public void testBinaryVersions() throws RODAException, IOException {
  final StoragePath containerStoragePath=StorageTestUtils.generateRandomContainerStoragePath();
  getStorage().createContainer(containerStoragePath);
  final StoragePath binaryStoragePath=StorageTestUtils.generateRandomResourceStoragePathUnder(containerStoragePath);
  final ContentPayload payload1=new RandomMockContentPayload();
  getStorage().createBinary(binaryStoragePath,payload1,false);
  String version1="String_Node_Str";
  getStorage().createBinaryVersion(binaryStoragePath,version1);
  final ContentPayload payload2=new RandomMockContentPayload();
  getStorage().updateBinaryContent(binaryStoragePath,payload2,false,false);
  String version2="String_Node_Str";
  getStorage().createBinaryVersion(binaryStoragePath,version2);
  try {
    getStorage().createBinaryVersion(binaryStoragePath,version1);
    fail("String_Node_Str");
  }
 catch (  AlreadyExistsException e) {
  }
  CloseableIterable<BinaryVersion> binaryVersions=getStorage().listBinaryVersions(binaryStoragePath);
  List<BinaryVersion> reusableBinaryVersions=new ArrayList<>();
  Iterables.addAll(reusableBinaryVersions,binaryVersions);
  assertEquals(2,reusableBinaryVersions.size());
  BinaryVersion binaryVersion1=getStorage().getBinaryVersion(binaryStoragePath,version1);
  assertEquals(version1,binaryVersion1.getLabel());
  assertNotNull(binaryVersion1.getCreatedDate());
  assertTrue(IOUtils.contentEquals(payload1.createInputStream(),binaryVersion1.getBinary().getContent().createInputStream()));
  getStorage().revertBinaryVersion(binaryStoragePath,version1);
  Binary binary=getStorage().getBinary(binaryStoragePath);
  testBinaryContent(binary,payload1);
  getStorage().deleteBinaryVersion(binaryStoragePath,version1);
  try {
    getStorage().getBinaryVersion(binaryStoragePath,version1);
    fail("String_Node_Str");
  }
 catch (  NotFoundException e) {
  }
  getStorage().deleteContainer(containerStoragePath);
}

Fixed version (ground truth):
@Test public void testBinaryVersions() throws RODAException, IOException {
  final StoragePath containerStoragePath=StorageTestUtils.generateRandomContainerStoragePath();
  getStorage().createContainer(containerStoragePath);
  final StoragePath binaryStoragePath=StorageTestUtils.generateRandomResourceStoragePathUnder(containerStoragePath);
  final ContentPayload payload1=new RandomMockContentPayload();
  getStorage().createBinary(binaryStoragePath,payload1,false);
  String version1="String_Node_Str";
  getStorage().createBinaryVersion(binaryStoragePath,version1);
  final ContentPayload payload2=new RandomMockContentPayload();
  getStorage().updateBinaryContent(binaryStoragePath,payload2,false,false);
  String version2="String_Node_Str";
  getStorage().createBinaryVersion(binaryStoragePath,version2);
  try {
    getStorage().createBinaryVersion(binaryStoragePath,version1);
    fail("String_Node_Str");
  }
 catch (  AlreadyExistsException e) {
  }
  CloseableIterable<BinaryVersion> binaryVersions=getStorage().listBinaryVersions(binaryStoragePath);
  List<BinaryVersion> reusableBinaryVersions=new ArrayList<>();
  Iterables.addAll(reusableBinaryVersions,binaryVersions);
  assertEquals(2,reusableBinaryVersions.size());
  BinaryVersion binaryVersion1=getStorage().getBinaryVersion(binaryStoragePath,version1);
  assertEquals(version1,binaryVersion1.getLabel());
  assertNotNull(binaryVersion1.getCreatedDate());
  assertTrue(IOUtils.contentEquals(payload1.createInputStream(),binaryVersion1.getBinary().getContent().createInputStream()));
  getStorage().revertBinaryVersion(binaryStoragePath,version1);
  Binary binary=getStorage().getBinary(binaryStoragePath);
  testBinaryContent(binary,payload1);
  getStorage().deleteBinaryVersion(binaryStoragePath,version1);
  try {
    getStorage().getBinaryVersion(binaryStoragePath,version1);
    fail("String_Node_Str");
  }
 catch (  NotFoundException e) {
  }
  getStorage().deleteResource(binaryStoragePath);
  try {
    getStorage().getBinaryVersion(binaryStoragePath,version1);
    fail("String_Node_Str");
  }
 catch (  NotFoundException e) {
  }
  getStorage().deleteContainer(containerStoragePath);
}