### Question:
AbstractTraverserIterator extends PrefetchingResourceIterator<Path> implements TraverserIterator { @Override public void close() { if ( resource != null ) { resource.close(); resource = null; } } protected  AbstractTraverserIterator( Resource resource ); @Override int getNumberOfPathsReturned(); @Override int getNumberOfRelationshipsTraversed(); @Override void relationshipTraversed(); @Override void unnecessaryRelationshipTraversed(); @Override void close();  }### Answer:
@Test public void shouldCloseResourceOnce() { AbstractTraverserIterator iter = new AbstractTraverserIterator( new AssertOneClose() ) { @Override protected Path fetchNextOrNull() { return null; } @Override public boolean isUniqueFirst( TraversalBranch branch ) { return false; } @Override public boolean isUnique( TraversalBranch branch ) { return false; } @Override public <STATE> Evaluation evaluate( TraversalBranch branch, BranchState<STATE> state ) { return null; } }; iter.close(); iter.close(); }