Implementing the MutableRoaring.toNewImmutableFromMutable() method