@Test
public void testNearestPowerOfTwo() {

    for (int i = -100; i < 1; i++) {
        assert FastMath.nearestPowerOfTwo(i) == 1;
    }
    for (int i = 1; i < 10000; i++) {
        int nextPowerOf2 = FastMath.nearestPowerOfTwo(i);
        assert i <= nextPowerOf2;
        assert FastMath.isPowerOfTwo(nextPowerOf2);
        assert nextPowerOf2 == nearestPowerOfTwoSlow(i);
    }
}