void (int count, IntConsumer task) { for (int i = 0; i < count; i++) { int threadIndex = i; myThreads.add(ApplicationManager.getApplication().executeOnPooledThread(() -> task.accept(threadIndex))); } }