Restrictions { public static SetExpression contains(String propertyName, Object value) { return contains(propertyName, new Object[] { value }); } private  Restrictions(); static EqualityExpression eq(String propertyName, Object value); static EqualityExpression ne(String propertyName, Object value); static EqualityExpression lt(String propertyName, Object value); static EqualityExpression lte(String propertyName, Object value); static EqualityExpression gt(String propertyName, Object value); static EqualityExpression gte(String propertyName, Object value); static RangeExpression between(String propertyName, Object from, Object to); static SetExpression discreteRange(String propertyName, int from, int to); static SetExpression in(String propertyName, Object[] values); static SetExpression in(String propertyName, Collection<? extends Object> values); static SetExpression notIn(String propertyName, Object[] values); static SetExpression notIn(String propertyName, Collection<? extends Object> values); static SetExpression contains(String propertyName, Object value); static SetExpression contains(String propertyName, Object[] values); static UnaryExpression isNull(String propertyName); static UnaryExpression isNotNull(String propertyName); static UnaryExpression isEmpty(String propertyName); static UnaryExpression isNotEmpty(String propertyName); static NativeExpression nativeQuery(Class<T> type, T expression); static Conjunction and(Criterion... criteria); static Disjunction or(Criterion... criteria); static Distance2dExpression<N> within(
            String propertyName, N x, N y, N distance);  }
@Test public void contains_one() { SetExpression e = Restrictions.contains(propertyName, value); assertEquals(Operator.CONTAINS, e.getOperator()); assertEquals(propertyName, e.getPropertyName()); assertEquals(value, e.getValues()[0]); assertEquals(1, e.getValues().length); }
@Test public void contains_many() { SetExpression e = Restrictions.contains(propertyName, values); assertEquals(Operator.CONTAINS, e.getOperator()); assertEquals(propertyName, e.getPropertyName()); assertArrayEquals(values, e.getValues()); }