### Question:
ReservoirRowSampler implements RowSampler { @Override public RelationalInputGenerator[] createSample(RelationalInputGenerator[] fileInputGenerators) throws AlgorithmConfigurationException { RelationalInputGenerator[] sampleGenerators = new RelationalInputGenerator[fileInputGenerators.length]; int i = 0; for(RelationalInputGenerator generator: fileInputGenerators){ try { ReservoirRowSample sample = new ReservoirRowSample(generator.generateNewCopy(), sampleSize); sampleGenerators[i++] = new SampleGenerator(sample); } catch (InputGenerationException e) { e.printStackTrace(); } } return sampleGenerators; } ReservoirRowSampler(int sampleSize); @Override RelationalInputGenerator[] createSample(RelationalInputGenerator[] fileInputGenerators);  }### Answer:
@Test public void testCreateSample() throws Exception { RelationalInputGenerator[] inputs = new RelationalInputGenerator[1]; RelationalInputBuilder builder = new RelationalInputBuilder("testTable") .setHeader("c0", "c1", "c2"); for(int i=0; i<20; i++){ builder.addRow("a", "b", i+""); } inputs[0] = builder.build(); int sampleSize = 10; ReservoirRowSampler sampler = new ReservoirRowSampler(sampleSize); RelationalInput samples = sampler.createSample(inputs)[0].generateNewCopy(); HashSet<List<String>> set = new HashSet<>(); while(samples.hasNext()){ List<String> sample = samples.next(); assertFalse(set.contains(sample)); set.add(sample); } assertEquals(set.size(), sampleSize); }