Buffer { char charAt(int pos) { int seg = pos / segmentLen; int off = pos % segmentLen; int index = begins[seg] + off; return buf.charAt(index); } Buffer(CharSequence sb, int segmentLen, long seed);   }
@Test public void firstFailure() { long seed = 1394639167285L; Buffer b = new Buffer(lng, 3, seed); StringBuilder recover = new StringBuilder(); for (int i = 0; i < lng.length(); i++) { recover.append(b.charAt(i)); } assertEquals(recover.toString(), lng); }