@Test
public void sourceSpecifiedTargetSpecifiedTopK() {

    ProcedureConfiguration configuration = ProcedureConfiguration.create(MapUtil.map("concurrency", concurrency));
    SimilarityStreamGenerator<CategoricalInput> generator = new SimilarityStreamGenerator<>(terminationFlag(), configuration, DECODER, COMPUTER);
    CategoricalInput[] ids = new CategoricalInput[3];
    ids[0] = new CategoricalInput(0, new long[]{});
    ids[1] = new CategoricalInput(1, new long[]{});
    ids[2] = new CategoricalInput(2, new long[]{});
    int[] sourceIndexIds = new int[]{1};
    int[] targetIndexIds = new int[]{0, 2};
    Stream<SimilarityResult> stream = generator.stream(ids, sourceIndexIds, targetIndexIds, -1.0, 1);
    List<SimilarityResult> rows = stream.collect(Collectors.toList());
    assertEquals(1, rows.size());
    assertThat(rows, hasItems(similarityResult(1, 0, false, false)));
}