### Question:
Criteria implements Cloneable { public Collection<Fetch> getFetchTypes() { return Collections.unmodifiableList(new ArrayList<Fetch>(m_fetchTypes)); } Criteria(final Class<?> clazz); void visit(final CriteriaVisitor visitor); Class<?> getCriteriaClass(); Collection<Order> getOrders(); void setOrders(final Collection<? extends Order> orderCollection); Collection<Fetch> getFetchTypes(); void setFetchTypes(final Collection<? extends Fetch> fetchTypes); Collection<Alias> getAliases(); void setAliases(final Collection<? extends Alias> aliases); Collection<Restriction> getRestrictions(); void setRestrictions(Collection<? extends Restriction> restrictions); void addRestriction(final Restriction restriction); boolean isDistinct(); void setDistinct(final boolean distinct); Integer getLimit(); void setLimit(final Integer limit); Integer getOffset(); void setOffset(final Integer offset); Class<?> getType(final String path); @Override String toString(); @Override Criteria clone();  }### Answer:
@Test public void testFetch() { final CriteriaBuilder cb = new CriteriaBuilder(OnmsAlarm.class); cb.fetch("firstEvent").fetch("lastEvent").fetch("distPoller", FetchType.LAZY); final Iterator<Fetch> i = cb.toCriteria().getFetchTypes().iterator(); assertEquals(FetchType.DEFAULT, i.next().getFetchType()); i.next(); assertEquals(FetchType.LAZY, i.next().getFetchType()); }