ReverseOrderOfBinaryNumber { public int reverse(int number) { int result = 0; while (number != 0) { result <<= 1; result |= number & 1; number >>= 1; } return result; }  int reverse(int number);  }
@Test public void shouldReturnZeroIfInputIsZero() { int input = 0; int result = reverseOrder.reverse(input); assertEquals(0, result); }
@Test public void shouldReturnOneIfInputIsOne() { int input = 1; int result = reverseOrder.reverse(input); assertEquals(1, result); }
@Test public void shouldReturnTheSameNumberIfIsFullOfOnes() { int input = 7; int result = reverseOrder.reverse(input); assertEquals(7, result); }
@Test public void shouldReturnBinaryNumberOrder() { int input = 13; int result = reverseOrder.reverse(input); assertEquals(11, result); }