@Test
public void testUnsignedLongParsing() {

  long val = CharSequences.parseUnsignedLong("  1234  ", 10, 2);
  Assert.assertEquals(1234L, val);
  val = CharSequences.parseUnsignedLong("  " + Long.MAX_VALUE + "  ", 10, 2);
  Assert.assertEquals(Long.MAX_VALUE, val);
  try {
    CharSequences.parseUnsignedLong("  " + Long.MAX_VALUE + "1  ", 10, 2);
    Assert.fail();
  } catch (NumberFormatException ex) {
    // expected
  }
}