@Test
public void testLoad() throws Exception {

  // save a vector manually
  Configuration conf = getConfiguration();
  Writable key = new IntWritable(0);
  Vector value = new DenseVector(VECTOR);
  Path path = getTestTempDirPath("output");
  FileSystem fs = FileSystem.get(path.toUri(), conf);
  // write the vector
  path = fs.makeQualified(path);
  fs.deleteOnExit(path);
  HadoopUtil.delete(conf, path);
  SequenceFile.Writer writer = new SequenceFile.Writer(fs, conf, path, IntWritable.class, VectorWritable.class);
  try {
    writer.append(key, new VectorWritable(value));
  } finally {
    Closeables.close(writer, false);
  }
  DistributedCache.setCacheFiles(new URI[] {path.toUri()}, conf);
  // load it
  Vector result = VectorCache.load(conf);
  
  // are they the same?
  assertNotNull("Vector is null", result);
  assertEquals("Loaded vector is not identical to original", result, value);
}