@SuppressWarnings("DuplicatedCode")
  public static int nextPowerOfTwo(int x) {
    if (x == 0) return 1;
    x--;
    x |= x >> 1;
    x |= x >> 2;
    x |= x >> 4;
    x |= x >> 8;
    return (x | x >> 16) + 1;
  }
@SuppressWarnings("DuplicatedCode")
  public static int nextPowerOfTwo(int x)