We have a list of tasks. Each task can depend on other tasks.If task A depends on task B, then B should run before A. Implement the method getTaskWithDependencies such that it returns a list of task names in the correct order. Example:If we want to execute task “application A”, the method should return: The…