datagen
datagen copied to clipboard
sampleMultiple: possible incorrect javadoc comments
https://github.com/qala-io/datagen/blob/523d0007a339ff8f7e4453c3ffcd063f4dfced6f/datagen/src/main/java/io/qala/datagen/RandomShortApi.java#L292-L310
I think that there 2 errors:
Set<T> sampleMultiplehas an incorrect comment "@return a random element from the collection" because it doesn't return an element but a set of elementsList<T> sampleMultiplementions that "elements don't repeat" but it returns a List that could have duplicates. Perhaps, this is addressed toSet<T> sampleMultiple?
List<T> sampleMultiple mentions that "elements don't repeat" but it returns a List that could have duplicates.
Are you saying that the result can have duplicates because the input may have duplicates? We can fix JavaDocs in that case to be clearer. The idea of the method is that it doesn't return same element twice (as opposed to sampling with replacement).