### Question:
SecurityTokenEvaluator extends TokenEvaluator<Security> { @Override public EvaluationResult evaluate( Security security, CalculationFunctions functions, String firstToken, List<String> remainingTokens) { MetaBean metaBean = MetaBean.of(security.getClass()); Optional<String> securityPropertyName = metaBean.metaPropertyMap().keySet().stream() .filter(p -> p.equalsIgnoreCase(firstToken)) .findFirst(); if (securityPropertyName.isPresent()) { Object propertyValue = metaBean.metaProperty(securityPropertyName.get()).get((Bean) security); return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("Property '{}' not set", firstToken); } Optional<String> securityInfoPropertyName = security.getInfo().propertyNames().stream() .filter(p -> p.equalsIgnoreCase(firstToken)) .findFirst(); if (securityInfoPropertyName.isPresent()) { Object propertyValue = security.getInfo().property(securityInfoPropertyName.get()).get(); return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("Property '{}' not set", firstToken); } Optional<String> securityPriceInfoPropertyName = security.getInfo().getPriceInfo().propertyNames().stream() .filter(p -> p.equalsIgnoreCase(firstToken)) .findFirst(); if (securityPriceInfoPropertyName.isPresent()) { Object propertyValue = security.getInfo().getPriceInfo().property(securityPriceInfoPropertyName.get()).get(); return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("Property '{}' not set", firstToken); } return invalidTokenFailure(security, firstToken); }  @Override Class<Security> getTargetType(); @Override Set<String> tokens(Security security); @Override EvaluationResult evaluate(
      Security security,
      CalculationFunctions functions,
      String firstToken,
      List<String> remainingTokens);  }### Answer:
@Test public void evaluate() { SecurityTokenEvaluator evaluator = new SecurityTokenEvaluator(); Security sec = security(); EvaluationResult quantity = evaluator.evaluate(sec, FUNCTIONS, "id", ImmutableList.of()); assertThat(quantity.getResult()).hasValue(ID); EvaluationResult initialPrice = evaluator.evaluate(sec, FUNCTIONS, "currency", ImmutableList.of()); assertThat(initialPrice.getResult()).hasValue(USD); EvaluationResult initialPrice2 = evaluator.evaluate(sec, FUNCTIONS, "Currency", ImmutableList.of()); assertThat(initialPrice2.getResult()).hasValue(USD); EvaluationResult foo = evaluator.evaluate(sec, FUNCTIONS, "foo", ImmutableList.of()); assertThat(foo.getResult()).isFailure(); }