### Question:
BigendianEncoding { static long longFromBase16String(CharSequence chars, int offset) { Utils.checkArgument(chars.length() >= offset + LONG_BASE16, "chars too small"); return (decodeByte(chars.charAt(offset), chars.charAt(offset + 1)) & 0xFFL) << 56 | (decodeByte(chars.charAt(offset + 2), chars.charAt(offset + 3)) & 0xFFL) << 48 | (decodeByte(chars.charAt(offset + 4), chars.charAt(offset + 5)) & 0xFFL) << 40 | (decodeByte(chars.charAt(offset + 6), chars.charAt(offset + 7)) & 0xFFL) << 32 | (decodeByte(chars.charAt(offset + 8), chars.charAt(offset + 9)) & 0xFFL) << 24 | (decodeByte(chars.charAt(offset + 10), chars.charAt(offset + 11)) & 0xFFL) << 16 | (decodeByte(chars.charAt(offset + 12), chars.charAt(offset + 13)) & 0xFFL) << 8 | (decodeByte(chars.charAt(offset + 14), chars.charAt(offset + 15)) & 0xFFL); } private  BigendianEncoding();   }### Answer:
@Test void longFromBase16String_InputTooSmall() { assertThrows( IllegalArgumentException.class, () -> BigendianEncoding.longFromBase16String(wrap(new char[LONG_BASE16]), 1), "chars too small"); }
@Test void longFromBase16String_UnrecognizedCharacters() { assertThrows( IllegalArgumentException.class, () -> BigendianEncoding.longFromBase16String("0123456789gbcdef", 0), "invalid character g"); }
@Test void longFromBase16String() { assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(FIRST_CHAR_ARRAY), 0)) .isEqualTo(FIRST_LONG); assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(SECOND_CHAR_ARRAY), 0)) .isEqualTo(SECOND_LONG); assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(BOTH_CHAR_ARRAY), 0)) .isEqualTo(FIRST_LONG); assertThat( BigendianEncoding.longFromBase16String( CharBuffer.wrap(BOTH_CHAR_ARRAY), BigendianEncoding.LONG_BASE16)) .isEqualTo(SECOND_LONG); }
@Test public void longFromBase16String_InputTooSmall() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("chars too small"); BigendianEncoding.longFromBase16String( CharBuffer.wrap(new char[BigendianEncoding.LONG_BASE16]), 1); }
@Test public void longFromBase16String_UnrecongnizedCharacters() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("invalid character g"); BigendianEncoding.longFromBase16String("0123456789gbcdef", 0); }
@Test public void longFromBase16String() { assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(FIRST_CHAR_ARRAY), 0)) .isEqualTo(FIRST_LONG); assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(SECOND_CHAR_ARRAY), 0)) .isEqualTo(SECOND_LONG); assertThat(BigendianEncoding.longFromBase16String(CharBuffer.wrap(BOTH_CHAR_ARRAY), 0)) .isEqualTo(FIRST_LONG); assertThat( BigendianEncoding.longFromBase16String( CharBuffer.wrap(BOTH_CHAR_ARRAY), BigendianEncoding.LONG_BASE16)) .isEqualTo(SECOND_LONG); }