public static void isPowerOfTwo ( int argument , String name ) { if ( Integer . bitCount ( argument ) != 1 ) { throw new IllegalArgumentException ( CommonI18n . argumentMustBePowerOfTwo . text ( name , argument ) ) ; } }
Check that the argument is a power of 2 .