void (Map<String, String> graph, String from, String to, String expectedPath) { List<String> shortestPath = getAlgorithmsInstance().findShortestPath(initGraph(graph), from, to); if (expectedPath != null) { assertNotNull(shortestPath); assertEquals(expectedPath, StringUtil.join(shortestPath, "")); } else { assertNull(shortestPath); } }