Description
I recently discovered your library and it's quite useful, thank you!
That being said, we massively use Vavr (https://github.com/vavr-io/vavr) collections instead of JDK ones, because of their immutability and more functional features/APIs.
Of course Random Beans don't work OOTB with Vavr collections, we get this kind of exceptions:
io.github.benas.randombeans.api.ObjectGenerationException: Unable to generate a random instance of type class Foo
Caused by: io.github.benas.randombeans.api.ObjectGenerationException: Unable to create type: io.vavr.collection.List for field: strings of class: Foo
Caused by: io.github.benas.randombeans.api.ObjectGenerationException: Unable to create an instance of type: interface io.vavr.collection.List
Caused by: java.lang.InstantiationError: io.vavr.collection.List
I took a quick look at your code and documentation (in particular https://github.com/benas/random-beans/wiki/Supported-types) and came to the conclusion that it would be possible, at least by manually writing Randomizer classes in the same spirit as SetRandomizer, ListRandomizer, etc.
Would that make sense to add support for it?
Please note that most common Vavr collections (like List, Set, Map) provide factory methods to build from JDK List/Set/Map (e.g. io.vavr.collection.List.ofAll(java.lang.Iterable)
).
I'm ok with helping (though I would let you the fun part of creating a new module etc. if you wish/accept to expose it as another Random Beans module) 😄.
Cheers