List<BuildChunkTask> () { List<BuildChunkTask> nextTasks = new SmartList<>(); for (BuildChunkTask task : myTasksDependsOnThis) { int dependenciesCount = task.myNotBuildDependenciesCount.decrementAndGet(); if (dependenciesCount == 0) { nextTasks.add(task); } } return nextTasks; }