src/main/java/org/dmfs/iterators/utils/SlimSet.java
private static Object[] rehash(final Object[] values, final int newSize)
    {
        Object[] newArray = new Object[newSize];

        for (Object value : values)
        {
            if (value == null)
            {
                continue;
            }

            newArray[predictedPosition(newArray, value, value.hashCode())] = value;
        }

        return newArray;
    }
private static Object[] rehash(final Object[] values, final int newSize)
    {
        Object[] newArray = new Object[newSize];

        for (Object value : values)
        {
            if (value == null)
            {
                continue;
            }

            newArray[predictedPosition(newArray, value, value.hashCode())] = value;
        }

        return newArray;
    }
Rebuild the backing array with a different size.

@param values
The values to put into the new array.
@param newSize
The size of the new array.

@return The new backing array.