code: public static FilterPredicate areEqual(FilterableAttribute attribute, Object value) {
          FilterPredicate pred = new FilterPredicate();
          pred.attribute = attribute;
          Class<?> requiredType = attribute.getType();
          if (!requiredType.isInstance(value)) {
              throw new IllegalArgumentException("The value must be of the correct type for the FilterableAttribute."
                                                 + " Expected: " + requiredType.getName() + " but was " + value.getClass().getName());
          }
  
          pred.values = Collections.singleton(getString(value));
          return pred;
      }
docs: Create a predicate specifying that the value of the specified attribute must exactly
  match the supplied value. The value must also be the type specified by the FilterableAttribute
  
  @param attribute The attribute to match on
  @param value The exact value that the attribute must have
  @throws IllegalArgumentException if the value is not of the type returned by the attributes getType method