### Question:
Constraints { public KeyPredicate toKeyPredicate() { Preconditions.checkNotNull(strategy, "Cannot produce a key predicate without a partition strategy"); return new KeyPredicate(constraints, strategy); } Constraints(Schema schema);  Constraints(Schema schema, PartitionStrategy strategy); private  Constraints(Schema schema, PartitionStrategy strategy,
                      Map<String, Predicate> constraints,
                      Map<String, Object> provided); private  Constraints(Constraints copy, String name, Predicate predicate); private  Constraints(Constraints copy,
                      String name, Predicate predicate, Object value); Predicate<E> toEntityPredicate(EntityAccessor<E> accessor); Predicate<E> toEntityPredicate(StorageKey key, EntityAccessor<E> accessor); Iterator<E> filter(Iterator<E> iterator, EntityAccessor<E> accessor); KeyPredicate toKeyPredicate(); Iterable<MarkerRange> toKeyRanges(); @SuppressWarnings("unchecked") boolean alignedWithBoundaries(); Map<String, Object> getProvidedValues(); @SuppressWarnings("unchecked") Constraints with(String name, Object... values); Constraints from(String name, Comparable value); Constraints fromAfter(String name, Comparable value); Constraints to(String name, Comparable value); Constraints toBefore(String name, Comparable value); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Map<String, String> toQueryMap(); Map<String, String> toNormalizedQueryMap(); static Constraints fromQueryMap(Schema schema,
                                         PartitionStrategy strategy,
                                         Map<String, String> query); boolean isUnbounded();  }### Answer:
@Test public void testEmptyConstraintsKeyPredicateRequiresStrategy() { TestHelpers.assertThrows("Cannot produce a key Predicate without strategy", NullPointerException.class, new Runnable() { @Override public void run() { new Constraints(schema).toKeyPredicate(); } }); }