@Test
public void testSelectFileSetRollbackVersion() {

  FileSetInfo fileSetInfo = new FileSetInfo();
  fileSetInfo.numVersionsToKeep = 4;
  fileSetInfo.oldServingInfoList = ImmutableList.of(
      new FileSetInfo.ServingInfo("/hdfs/path/1", "resource", 1000, PartitionerType.MODULUS),
      new FileSetInfo.ServingInfo("/hdfs/path/2", "resource", 1000, PartitionerType.MODULUS),
      new FileSetInfo.ServingInfo("/hdfs/path/3", "resource", 1000, PartitionerType.MODULUS)
  );
  int expectedVersionIndex = 1;
  ByteArrayInputStream inputStream =
      new ByteArrayInputStream((String.valueOf(expectedVersionIndex) + "\n").getBytes());
  int versionIndex = TerrapinAdmin.selectFileSetRollbackVersion(fileSetInfo, inputStream);
  assertEquals(expectedVersionIndex, versionIndex);
}