textproducer.word(int count) with 117 elements results in an empty response.
Scrier opened this issue · 0 comments
Scrier commented
If you call the TextProducer class method word with exactly 117 items, you will receive an empty result back.
So the following example:
Faityr.create().textProducer().word(117);
will result in an empty string. This has to do with it being 117 words available in the internal representation of the words in TextProducerInternal is of size 117, wish results in the method in BaseProducer:
public <T> List<T> randomElements(List<T> elements, int count) {
Collections.shuffle(elements, this.random);
return elements.subList(0, count % elements.size());
}
the sublist will become 0, 117%117 = 0, so no result will be returned. This depends on the number of words available of course, but I assume that it's not the expected result wished for.