Utils { public static int setBitRange(final int val, final int start, final int len, final int newVal) { int mask = ((1 << len) - 1) << start; return (val & ~mask) | ((newVal << start) & mask); } private  Utils(); static byte[] concatByteArray(final byte[] a, final byte[] b); static int getBitRange(final int b, final int s, final int n); static int mergeBytes(final int high, final int low); static int setBitRange(final int val,
            final int start, final int len, final int newVal); static byte[] splitInteger(final int value); static String toHex(final byte[] data);  }
@Test public void testSetBitRange() { int val = 1; int start = 0; int len = 1; int newVal = 1; int expResult = 1; int result = Utils.setBitRange(val, start, len, newVal); assertEquals(expResult, result); }