@Test
public void testExternalValue() {

  final int value = 1234;
  final JBBPNamedNumericFieldMap map = new JBBPNamedNumericFieldMap((fieldName, numericFieldMap, compiledBlock) -> {
    if (fieldName.equals("value")) {
      return value;
    }
    assertNotNull(numericFieldMap);
    assertNotNull(compiledBlock);
    fail("Unexpected request for value [" + fieldName + ']');
    return -1;
  });
  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("value", -1);
  assertEquals(value, expr.eval(null, 0, compiledBlock, map));
}