harbor run -t openthoughts/tasktrove-exp-rpt-stack-junit-v6-stack-junit-2181harbor download openthoughts/tasktrove-exp-rpt-stack-junit-v6-stack-junit-2181Implement Java sources under /app/ so that the JUnit test file at /tests/TestSolution.java compiles and passes. The test uses the default (unnamed) package — your sources should also be in the default package (place files directly under /app/ without a package declaration).
tests/TestSolution.java)Below is a deterministic summary of what the JUnit test file expects. Use this as the source of truth for package, imports, and public API. If the original task description above conflicts with this section, prefer this section.
Language: Java
Test package: (default/unnamed package) — your sources should also be in the default package (placed directly in /app/, with no package declaration).
Test class: SearchUnitTest1
Well-known imports (JUnit, JDK, common libs — already on the classpath):
java.io.IOExceptionjava.util.Listorg.junit.Afterorg.junit.Beforeorg.junit.TestStatic imports (constants/methods referenced statically):
import static org.junit.Assert.*;Symbols the test references that you likely need to define (class/enum/interface names not coming from JDK or JUnit):
BFDFDiGraph — constructed via new DiGraph(...) with arities: 0 argsEdgeGraphGraphIONodeSAMETestGraphBDS01TestGraphBS03TestGraphDS03TestsMethods the test invokes on instances (you must expose at least these with the indicated arity; return type inferred from how the test uses the result):
.breadthFirstSearch(...) — called with: 1 arg.depthFirstSearch(...) — called with: 1 arg.get(...) — called with: 1 arg.loadGraph(...) — called with: 1 arg.print(...) — called with: 1 arg.printStackTrace(...) — called with: 0 args.println(...) — called with: 1 arg.setShowSteps(...) — called with: 1 argtests/TestSolution.java against JUnit's standalone console (/junit/junit-platform-console-standalone.jar) — both JUnit 4 (org.junit.*) and JUnit Jupiter (org.junit.jupiter.api.*) APIs are available.pom.xml exists in /app, the grader runs mvn test instead. Otherwise it runs javac over every .java file under /app plus tests/TestSolution.java, then executes JUnit Console with --scan-class-path./app/ in directories that match the package declaration. For example, a class in package com.foo.bar; must live at /app/com/foo/bar/<ClassName>.java (or under a Maven layout like /app/src/main/java/com/foo/bar/).imports_project, wildcard-imported packages, and the test's own package) must resolve to source files you create.Task: Implement a small directed graph framework and loader that enables DFS and BFS traversals in a deterministic order, and wire it to load graphs from text files used by the tests.
What to implement (self-contained in /app/):
Graph interface
Node class
Edge class
DiGraph class (implements Graph)
GraphIO class
Notes and guidance for passing the provided tests:
Project layout (to place under /app/):
This task results in a small, self-contained graph utility library in Java 8 that the existing tests can use to verify DFS and BFS orders from file-based graph inputs.