Collector.collected behaves properly for large inputs