public static int roundToPowerOfTwo(final int value){
  return 1 << (32 - Integer.numberOfLeadingZeros(value - 1));
}

public static int roundToPowerOfTwo ( final int value ) { return 1 << ( 32 - Integer . numberOfLeadingZeros ( value - 1 ) ) ; }
find the next larger positive power of two value up from the given value . if value is a power of two then this value will be returned .
