Code reuse and basic tests

- Reused some code for drainTo(Collection).
- Committed the associated basic tests