@@ -255,6 +255,8 @@ public void testLeftShift() {
255255 @ Test
256256 public void testRightShift () {
257257 byte [] test = new byte []{0 , 0 , 16 , 0 };
258+ assertEquals (0b01111110, 0b11111101 >>> 1 );
259+ assertArrayEquals (new byte []{0b00101101, (byte ) 0b01111110}, Util .shiftRight (new byte []{0b01011010, (byte ) 0b11111101}, 1 ));
258260 assertArrayEquals (new byte []{0 , -128 , -128 , -128 }, Util .shiftRight (new byte []{1 , 1 , 1 , 1 }, 1 ));
259261 assertArrayEquals (new byte []{0 , -128 , 66 , 0 }, Util .shiftRight (new byte []{2 , 1 , 8 , 2 }, 2 ));
260262 assertArrayEquals (new byte []{0 , -128 , 66 , 0 }, new BigInteger (new byte []{2 , 1 , 8 , 2 }).shiftRight (2 ).toByteArray ());
@@ -275,8 +277,8 @@ public void testRightShift() {
275277 byte [] actual = Util .shiftRight (rnd .copy ().array (), shift );
276278
277279 System .out .println ("Original \t " + rnd .encodeBinary ());
278- System .out .println ("Expected \t " + Bytes .wrap (expected ).encodeBinary ());
279- System .out .println ("Actual \t " + Bytes .wrap (actual ).encodeBinary () + "\n \n " );
280+ System .out .println ("Expected \t " + Bytes .wrap (expected ).encodeBinary ());
281+ System .out .println ("Actual \t " + Bytes .wrap (actual ).encodeBinary () + "\n \n " );
280282
281283 assertArrayEquals (expected , actual );
282284 }
0 commit comments