public static int modPowerOfTwo(int a, int b) {
        return a & (b - 1);
    }
@Test
    public void testModPowerOfTwo() {
        int[] aParams = new int[]{
                0,
                1,
                Integer.MAX_VALUE / 2,
                Integer.MAX_VALUE,
        };
        int[] bParams = new int[]{
                1,
                2,
                1024,
                powerOfTwo(10),
                powerOfTwo(20),
        };

        for (int a : aParams) {
            for (int b : bParams) {
                assertEquals(a % b, QuickMath.modPowerOfTwo(a, b));
            }
        }
    }