### Question:
QueryModifiers implements Serializable { public static QueryModifiers limit(@Nonnegative long limit) { return new QueryModifiers(limit, null); } private  QueryModifiers();  QueryModifiers(@Nullable Long limit, @Nullable Long offset);  QueryModifiers(QueryModifiers modifiers); static QueryModifiers limit(@Nonnegative long limit); static QueryModifiers offset(@Nonnegative long offset); @Nullable Long getLimit(); @Nullable Integer getLimitAsInteger(); @Nullable Long getOffset(); @Nullable Integer getOffsetAsInteger(); boolean isRestricting(); List<T> subList(List<T> list); @Override boolean equals(Object o); @Override int hashCode(); static final QueryModifiers EMPTY; }### Answer:
@Test public void limit() { QueryModifiers modifiers = QueryModifiers.limit(12L); assertEquals(Long.valueOf(12), modifiers.getLimit()); assertNull(modifiers.getOffset()); assertTrue(modifiers.isRestricting()); }
@Test(expected = IllegalArgumentException.class) public void illegalLimit() { QueryModifiers.limit(-1); }