@Test public void shouldDetectEvenAndOddNumbers() { assertTrue(BitUtil.isEven(0)); assertTrue(BitUtil.isEven(2)); assertTrue(BitUtil.isEven(MIN_VALUE)); assertFalse(BitUtil.isEven(1)); assertFalse(BitUtil.isEven(-1)); assertFalse(BitUtil.isEven(MAX_VALUE)); }
public static boolean isEven(final int value) { return (value & LAST_DIGIT_MASK) == 0; }
BitUtil { public static boolean isEven(final int value) { return (value & LAST_DIGIT_MASK) == 0; } }
BitUtil { public static boolean isEven(final int value) { return (value & LAST_DIGIT_MASK) == 0; } private  BitUtil(); }
BitUtil { public static boolean isEven(final int value) { return (value & LAST_DIGIT_MASK) == 0; } private  BitUtil(); static int findNextPositivePowerOfTwo(final int value); static long findNextPositivePowerOfTwo(final long value); static int align(final int value, final int alignment); static byte[] fromHexByteArray(final byte[] buffer); static byte[] toHexByteArray(final byte[] buffer); static byte[] toHexByteArray(final byte[] buffer, final int offset, final int length); static byte[] toHexByteArray(final CharSequence charSequence, final int offset, final int length); static byte[] fromHex(final String string); static String toHex(final byte[] buffer, final int offset, final int length); static String toHex(final byte[] buffer); static boolean isEven(final int value); static boolean isEven(final long value); static boolean isPowerOfTwo(final int value); static boolean isPowerOfTwo(final long value); static int next(final int current, final int max); static int previous(final int current, final int max); static int calculateShiftForScale(final int scale); static int generateRandomisedId(); static boolean isAligned(final long address, final int alignment); }
BitUtil { public static boolean isEven(final int value) { return (value & LAST_DIGIT_MASK) == 0; } private  BitUtil(); static int findNextPositivePowerOfTwo(final int value); static long findNextPositivePowerOfTwo(final long value); static int align(final int value, final int alignment); static byte[] fromHexByteArray(final byte[] buffer); static byte[] toHexByteArray(final byte[] buffer); static byte[] toHexByteArray(final byte[] buffer, final int offset, final int length); static byte[] toHexByteArray(final CharSequence charSequence, final int offset, final int length); static byte[] fromHex(final String string); static String toHex(final byte[] buffer, final int offset, final int length); static String toHex(final byte[] buffer); static boolean isEven(final int value); static boolean isEven(final long value); static boolean isPowerOfTwo(final int value); static boolean isPowerOfTwo(final long value); static int next(final int current, final int max); static int previous(final int current, final int max); static int calculateShiftForScale(final int scale); static int generateRandomisedId(); static boolean isAligned(final long address, final int alignment); static final int SIZE_OF_BYTE; static final int SIZE_OF_BOOLEAN; static final int SIZE_OF_CHAR; static final int SIZE_OF_SHORT; static final int SIZE_OF_INT; static final int SIZE_OF_FLOAT; static final int SIZE_OF_LONG; static final int SIZE_OF_DOUBLE; static final int CACHE_LINE_LENGTH; }