### Question:
Preconditions { public static long requirePowerOfTwo( long value ) { if ( !isPowerOfTwo( value ) ) { throw new IllegalArgumentException( "Expected long value to be a non zero power of 2, got " + value ); } return value; } private  Preconditions(); static long requirePositive( long value ); static long requirePowerOfTwo( long value ); static int requirePositive( int value ); static long requireNonNegative( long value ); static int requireNonNegative( int value ); static int requireExactlyZero( int value ); static void checkState( boolean expression, String message ); static void checkArgument( boolean expression, String message, Object... args ); static void requireBetween( int value, int lowInclusive, int highExclusive );  }### Answer:
@Test void requirePowerOfTwo() { assertEquals( 1, Preconditions.requirePowerOfTwo( 1 ) ); assertEquals( 2, Preconditions.requirePowerOfTwo( 2 ) ); assertEquals( 128, Preconditions.requirePowerOfTwo( 128 ) ); assertEquals( 0b01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000L, Preconditions.requirePowerOfTwo( 0b01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000L ) ); assertThrows( IllegalArgumentException.class, () -> Preconditions.requirePowerOfTwo( -1 ), "negative" ); assertThrows( IllegalArgumentException.class, () -> Preconditions.requirePowerOfTwo( 0 ), "zero" ); assertThrows( IllegalArgumentException.class, () -> Preconditions.requirePowerOfTwo( 3 ), "three" ); assertThrows( IllegalArgumentException.class, () -> Preconditions.requirePowerOfTwo( 0b10000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000L ), "sign bit" ); }