public static Constant constant(Object value) {
    if (value == null) {
      throw new NullPointerException(String.format("value argument is null. Use method %s.constantOfType(Object, Type)", Expressions.class.getSimpleName()));
    }
    return constantOfType(value, value.getClass());
  }
A set of predefined utilities and factories for expressions like {@link Constant} or {@link Call}
criteria/common/src/org/immutables/criteria/expression/Expressions.java