@Test
public void testMatch() throws IOException {

    String data = "C=c;B=&&B1=b1;A=&&A1=a1;A2=a2;A3=a3&&&&";
    PushbackReader reader = new PushbackReader(new StringReader(data));
    CharBuffer buffer = CharBuffer.allocate(10);
    int len = ReaderStream.of(reader)
            .next()
                .when(c -> c =='=')
                .then()
                    .next(2)
                        .when(c -> Arrays.equals(c,new char[]{'&','&'}))
                        .then(() -> {
                            System.out.print("is '=&&'");
                        })
                        .back()
                    .back()
                .then(() -> {
                    System.out.print("is '='");
                })
                .done()
            .read(buffer);
    assertEquals(len,1);
}