code: public static long nextPowerOfTwo (final long nValue)
    {
      if (nValue == 0)
        return 1;
      long x = nValue - 1;
      x |= x >> 1;
      x |= x >> 2;
      x |= x >> 4;
      x |= x >> 8;
      x |= x >> 16;
      return (x | x >> 32) + 1;
    }
docs: Return the least power of two greater than or equal to the specified value.
  <p>
  Note that this function will return 1 when the argument is 0.
  
  @param nValue
  a long integer smaller than or equal to 2<sup>62</sup>.
  @return the least power of two greater than or equal to the specified
  value.