private static function pick(array $collection, $count = 0, $force = false)
    {
        if (count($collection) < $count) {
            if ($force) {
                return $collection;
            }
            throw new \LogicException("Cannot pick more elements ({$count}) than there are in the collection.");
        }

        $picked = [];
        if (0 !== $count) {
            $randomSelect = array_rand($collection, $count);
            if (is_int($randomSelect)) {
                // only one element has been picked
                $randomSelect = [$randomSelect];
            }

            // put back original collection order
            sort($randomSelect, SORT_NUMERIC);

            foreach ($randomSelect as $randomIndex) {
                $picked[] = $collection[$randomIndex];
            }
        } else {
            $picked = $collection;
        }

        return $picked;
    }