### Question:
SixBit { public static long getValue(int from, int to, boolean[] bitSet) { if (to > bitSet.length) { throw new SixBitException(bitSet.length + " is not enough bits. At least " + to + " expected."); } long val = 0; long powMask = 1; for (int i = to - 1; i >= from; i--) { if (bitSet[i]) { val += powMask; } powMask <<= 1; } return val; }  static void convertSixBitToBits(String str, int padBits, boolean bitSet[],
	        boolean[] calculated, int from, int to); static long getValue(int from, int to, boolean[] bitSet); static long getSignedValue(int from, int to, boolean[] bitSet); static String getString(int from, int to, boolean[] bitSet);  }### Answer:
@Test public void testGetValueFirstBitSet() { boolean[] bits = { true, true, false }; assertEquals(6, SixBit.getValue(0, 3, bits)); }
@Test public void testGetValueFirstBitNotSet() { boolean[] bits = { false, true, false }; assertEquals(2, SixBit.getValue(0, 3, bits)); }
@Test public void testGetValueZero() { boolean[] bits = { false, false, false }; assertEquals(0, SixBit.getValue(0, 3, bits)); }
@Test public void testGetValueMax() { boolean[] bits = { true, true, true }; assertEquals(7, SixBit.getValue(0, 3, bits)); }