@Test void testWalkFromRootWithCondition() { StorageAsset root = createTree( ); StopVisitStatus status = new StopVisitStatus( ); status.setStopCondition( a -> a.getName().equals("001002003") ); StorageUtil.walk( root, status ); assertEquals( "001002003", status.getLast( ).getName() ); int expected = LEVEL2 * LEVEL3 + LEVEL2 + 2 * LEVEL3 + 1 + 1 + 1 + 4; assertEquals( expected, status.size() ); }
public static void walk( StorageAsset start, Consumer<StorageAsset> consumer ) { try(Stream<StorageAsset> assetStream = newAssetStream( start, false )) { assetStream.forEach( consumer::accept ); } }
StorageUtil { public static void walk( StorageAsset start, Consumer<StorageAsset> consumer ) { try(Stream<StorageAsset> assetStream = newAssetStream( start, false )) { assetStream.forEach( consumer::accept ); } } }
StorageUtil { public static void walk( StorageAsset start, Consumer<StorageAsset> consumer ) { try(Stream<StorageAsset> assetStream = newAssetStream( start, false )) { assetStream.forEach( consumer::accept ); } }  }
StorageUtil { public static void walk( StorageAsset start, Consumer<StorageAsset> consumer ) { try(Stream<StorageAsset> assetStream = newAssetStream( start, false )) { assetStream.forEach( consumer::accept ); } }  static void walk( StorageAsset start, Consumer<StorageAsset> consumer ); static void walk( StorageAsset start, Function<StorageAsset, Boolean> consumer ); static Stream<StorageAsset> newAssetStream( StorageAsset start, boolean parallel ); static Stream<StorageAsset> newAssetStream( StorageAsset start); static final void deleteRecursively(StorageAsset baseDir); static final boolean deleteRecursively(final StorageAsset baseDir, final boolean stopOnError); static final void moveAsset(StorageAsset source, StorageAsset target, boolean locked, CopyOption... copyOptions); static final void copy( final ReadableByteChannel is, final WritableByteChannel os ); static final void copy( final FileChannel is, final WritableByteChannel os ); static final void copy( final ReadableByteChannel is, final FileChannel os ); static final String getExtension(StorageAsset asset); }
StorageUtil { public static void walk( StorageAsset start, Consumer<StorageAsset> consumer ) { try(Stream<StorageAsset> assetStream = newAssetStream( start, false )) { assetStream.forEach( consumer::accept ); } }  static void walk( StorageAsset start, Consumer<StorageAsset> consumer ); static void walk( StorageAsset start, Function<StorageAsset, Boolean> consumer ); static Stream<StorageAsset> newAssetStream( StorageAsset start, boolean parallel ); static Stream<StorageAsset> newAssetStream( StorageAsset start); static final void deleteRecursively(StorageAsset baseDir); static final boolean deleteRecursively(final StorageAsset baseDir, final boolean stopOnError); static final void moveAsset(StorageAsset source, StorageAsset target, boolean locked, CopyOption... copyOptions); static final void copy( final ReadableByteChannel is, final WritableByteChannel os ); static final void copy( final FileChannel is, final WritableByteChannel os ); static final void copy( final ReadableByteChannel is, final FileChannel os ); static final String getExtension(StorageAsset asset);  }