@Test
public void testCounterOfStreamAsParameter() throws Exception {

  final List<JBBPNamedFieldInfo> list = new ArrayList<>();
  final byte[] compiled = new byte[] {0};
  final JBBPCompiledBlock compiledBlock = JBBPCompiledBlock.prepare().setCompiledData(compiled).setSource("none").setNamedFieldData(list).build();
  JBBPOnlyFieldEvaluator expr = new JBBPOnlyFieldEvaluator("$", -1);
  final JBBPBitInputStream inStream = new JBBPBitInputStream(new ByteArrayInputStream(new byte[] {1, 2, 3, 4, 5}));
  inStream.read();
  inStream.read();
  inStream.read();
  assertEquals(3, expr.eval(inStream, 0, compiledBlock, null));
}