@Test
public void testRunInverted() throws Exception {

  Path input = getTestTempDirPath("input");
  Path output = getTestTempDirPath("output");
  Path seedsPath = getTestTempDirPath("seeds");
  List<VectorWritable> points = getPointsWritable(REFERENCE);
  List<VectorWritable> seeds = getPointsWritable(SEEDS);
  Configuration conf = new Configuration();
  ClusteringTestUtils.writePointsToFile(points, true, new Path(input, "file1"), fs, conf);
  ClusteringTestUtils.writePointsToFile(seeds, true, new Path(seedsPath, "part-seeds"), fs, conf);
  String[] args = {optKey(DefaultOptionCreator.INPUT_OPTION), input.toString(),
      optKey(VectorDistanceSimilarityJob.SEEDS), seedsPath.toString(), optKey(DefaultOptionCreator.OUTPUT_OPTION),
      output.toString(), optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION),
      EuclideanDistanceMeasure.class.getName(),
      optKey(VectorDistanceSimilarityJob.OUT_TYPE_KEY), "v"
  };
  ToolRunner.run(new Configuration(), new VectorDistanceSimilarityJob(), args);
  DummyOutputCollector<Text, VectorWritable> collector = new DummyOutputCollector<Text, VectorWritable>();
  for (Pair<Text, VectorWritable> record :  new SequenceFileIterable<Text, VectorWritable>(
      new Path(output, "part-m-00000"), conf)) {
    collector.collect(record.getFirst(), record.getSecond());
  }
  assertEquals(REFERENCE.length, collector.getData().size());
  for (Map.Entry<Text, List<VectorWritable>> entry : collector.getData().entrySet()) {
    assertEquals(SEEDS.length, entry.getValue().iterator().next().get().size());
  }
}