### Question:
TradeTokenEvaluator extends TokenEvaluator<Trade> { @Override public EvaluationResult evaluate( Trade trade, CalculationFunctions functions, String firstToken, List<String> remainingTokens) { MetaBean metaBean = MetaBean.of(trade.getClass()); Optional<String> tradePropertyName = metaBean.metaPropertyMap().keySet().stream() .filter(p -> p.equalsIgnoreCase(firstToken)) .findFirst(); if (tradePropertyName.isPresent()) { Object propertyValue = metaBean.metaProperty(tradePropertyName.get()).get((Bean) trade); if (propertyValue == null) { return EvaluationResult.failure("Property '{}' not set", firstToken); } return EvaluationResult.success(propertyValue, remainingTokens); } Optional<String> tradeInfoPropertyName = trade.getInfo().propertyNames().stream() .filter(p -> p.equalsIgnoreCase(firstToken)) .findFirst(); if (tradeInfoPropertyName.isPresent()) { Object propertyValue = trade.getInfo().property(tradeInfoPropertyName.get()).get(); if (propertyValue == null) { return EvaluationResult.failure("Property '{}' not set", firstToken); } return EvaluationResult.success(propertyValue, remainingTokens); } return invalidTokenFailure(trade, firstToken); }  @Override Class<Trade> getTargetType(); @Override Set<String> tokens(Trade trade); @Override EvaluationResult evaluate(
      Trade trade,
      CalculationFunctions functions,
      String firstToken,
      List<String> remainingTokens);  }### Answer:
@Test public void evaluate() { TradeTokenEvaluator evaluator = new TradeTokenEvaluator(); Trade trade = trade(); EvaluationResult quantity = evaluator.evaluate(trade, FUNCTIONS, "quantity", ImmutableList.of()); assertThat(quantity.getResult()).hasValue(123d); EvaluationResult initialPrice = evaluator.evaluate(trade, FUNCTIONS, "price", ImmutableList.of()); assertThat(initialPrice.getResult()).hasValue(456d); EvaluationResult initialPrice2 = evaluator.evaluate(trade, FUNCTIONS, "price", ImmutableList.of()); assertThat(initialPrice2.getResult()).hasValue(456d); EvaluationResult counterparty = evaluator.evaluate(trade, FUNCTIONS, "counterparty", ImmutableList.of()); assertThat(counterparty.getResult()).hasValue(StandardId.of("cpty", "a")); EvaluationResult tradeTime = evaluator.evaluate(trade, FUNCTIONS, "tradeTime", ImmutableList.of()); assertThat(tradeTime.getResult()).isFailure(); EvaluationResult foo = evaluator.evaluate(trade, FUNCTIONS, "foo", ImmutableList.of()); assertThat(foo.getResult()).isFailure(); }