class Graph {

    public Map<Integer, Set<String>> getGraphWithLongestPaths() {

        longestsPath = new HashMap<>();
        Map<Integer, Integer> paths = findAllLongestsPath(roots);
        if (paths != null) {
            for (final Map.Entry<Integer, Integer> e : paths.entrySet()) {
                final Integer unitId = e.getKey();
                final Integer level = e.getValue();
                if (longestsPath.containsKey(level) && longestsPath.get(level) != null) {
                    // add value
                    longestsPath.get(level).add(indexMapping.get(unitId));

                } else {
                    final Set<String> units = new HashSet<>();
                    units.add(indexMapping.get(unitId));
                    longestsPath.put(level, units);
                }
            }
        }
        paths = null;
        return longestsPath;
    }

    public  Graph(JsonNode jsonGraph);

}