EarlyLimitStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy { public static EarlyLimitStrategy instance() { return INSTANCE; } private  EarlyLimitStrategy(); @SuppressWarnings("unchecked") @Override void apply(final Traversal.Admin<?, ?> traversal); static EarlyLimitStrategy instance();  }
@Test public void doTest() { final TraversalStrategies strategies = new DefaultTraversalStrategies(); strategies.addStrategies(EarlyLimitStrategy.instance()); for (final TraversalStrategy strategy : this.otherStrategies) { strategies.addStrategies(strategy); if (strategy instanceof ProfileStrategy) { final TraversalStrategies os = new DefaultTraversalStrategies(); os.addStrategies(ProfileStrategy.instance()); this.optimized.asAdmin().setStrategies(os); this.optimized.asAdmin().applyStrategies(); } } this.original.asAdmin().setStrategies(strategies); this.original.asAdmin().applyStrategies(); assertEquals(this.optimized, this.original); }