### Question:
AssetSpliterator implements Spliterator<StorageAsset>, Closeable { @Override public void forEachRemaining( Consumer<? super StorageAsset> action ) { try { while ( true ) { consumeAsset( action, workList.getLast( ) ); } } catch (NoSuchElementException e) { } } AssetSpliterator( int splitThreshold, StorageAsset... assets);  AssetSpliterator( StorageAsset... assets); protected  AssetSpliterator(); protected  AssetSpliterator( int splitThreshold); protected  AssetSpliterator( int splitThreshold, Set<StorageAsset> visitedContainers); protected  AssetSpliterator( List<StorageAsset> baseList, Set<StorageAsset> visitedContainers); @Override void close( ); @Override boolean tryAdvance( Consumer<? super StorageAsset> action ); @Override void forEachRemaining( Consumer<? super StorageAsset> action ); @Override Spliterator<StorageAsset> trySplit( ); @Override long estimateSize( ); @Override int characteristics( ); static final int DEFAULT_SPLIT_THRESHOLD; }### Answer:
@Test void forEachRemaining( ) { StorageAsset root = createTree( ); AssetSpliterator spliterator = new AssetSpliterator( root ); final ConsumeVisitStatus status = new ConsumeVisitStatus( ); spliterator.forEachRemaining( status ); assertEquals( LEVEL1*LEVEL2*LEVEL3+LEVEL1*LEVEL2+LEVEL1+1 , status.size( ) ); assertEquals( root, status.getLast( ) ); }
@Test void forEachRemaining3( ) { StorageAsset root = createTree( ); StorageAsset testRoot = root.list( ).get( 1 ); AssetSpliterator spliterator = new AssetSpliterator( testRoot ); final ConsumeVisitStatus status = new ConsumeVisitStatus( ); spliterator.forEachRemaining( status ); int expected = LEVEL2 * LEVEL3 + LEVEL2 + 1; assertEquals( expected , status.size( ) ); assertEquals( testRoot, status.getLast( ) ); }