DefaultSearchDepthPolicy extends AbstractPolicy implements SearchDepthPolicy { public boolean levelEnabled(int level) { return this.maximumDepth >= level; }  boolean continueSearch(SearchResult searchResult); int getMaximumDepth(); @Override List<Search> inputForSubSearches(SearchResult searchResult); @Override String getDescription(); boolean levelEnabled(int level); boolean nextLevelEnabled(Request request); void setMaximumDepth(int maximumDepth); boolean isAssignedValueRequestsCanSpawnSubsearch(); void setAssignedValueRequestsCanSpawnSubsearch(boolean assignedValueRequestsCanSpawnSubsearch); @Override int hashCode(); @Override boolean equals(Object obj); static final boolean DEFAULT_ASSIGNED_VALUE_REQUESTS_CAN_SPAWN_SUBSEARCH; static final int DEFAULT_MAX_DEPTH; }
@Test public void testLevelEnabled() { int maxLevel = this.policy.getMaximumDepth(); assertTrue(this.policy.levelEnabled(maxLevel - 1)); assertTrue(this.policy.levelEnabled(maxLevel)); assertFalse(this.policy.levelEnabled(maxLevel + 1)); }