}
}
@Test
public void testSimple() {
StringSampler s = new StringSampler();
s.setDist(ImmutableMap.of("a", "3", "b", 5, "c", 1.0));
Multiset<String> counts = HashMultiset.create();
for (int i = 0; i < 1000; i++) {
counts.add(s.sample().asText());
}
assertEquals(3, counts.elementSet().size());
check(counts, "a", 1000 * 3.0 / 9.0);
check(counts, "b", 1000 * 5.0 / 9.0);