quicktheories / QuickTheories

Property based testing for Java 8
Apache License 2.0
505 stars 51 forks source link

Switched Lists.listOf to use new ArrayList(size) constructor to avoid memory copies. Added new ArrayListDSL which mirrors the ListDSL to offer similar flexability #57

Open dcapwell opened 5 years ago

dcapwell commented 5 years ago

Adds a new generator for ArrayList which avoids using java.util.stream.Collector when size is know ahead of time. What I see with list generators is that a lot of time is spent growing the array (since Collector does not know the input size), so can avoid this by pre-allocating the array at the start.