class BeanTokenEvaluator extends TokenEvaluator<Bean> {

  @Override
  public Set<String> tokens(Bean bean) {
    if (bean.propertyNames().size() == 1) {
      String singlePropertyName = Iterables.getOnlyElement(bean.propertyNames());
      Object propertyValue = bean.property(singlePropertyName).get();
      Set<String> valueTokens = ValuePathEvaluator.tokens(propertyValue);

      return ImmutableSet.<String>builder()
          .add(singlePropertyName)
          .addAll(valueTokens)
          .build();
    } else {
      return bean.propertyNames();
    }
  }

}