Create Left Right Shift in Java