given trees, return path, object ids @param trees compare trees @return key path, val objectIds
(Map<String, String>... trees)
| 117 | * @return key path, val objectIds |
| 118 | */ |
| 119 | @SafeVarargs |
| 120 | public static Map<String, List<String>> compareTrees(Map<String, String>... trees) { |
| 121 | Map<String, List<String>> entries = new HashMap<>(1); |
| 122 | for (int i = 0; i < trees.length; i++) { |
| 123 | for (Map.Entry<String, String> entry : trees[i].entrySet()) { |
| 124 | String path = entry.getKey(); |
| 125 | String objectId = entry.getValue(); |
| 126 | entries.putIfAbsent(path, new ArrayList<>(Collections.nCopies(trees.length, null))); |
| 127 | entries.get(path).set(i, objectId); |
| 128 | } |
| 129 | } |
| 130 | return entries; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * key: path val: blob content |
no outgoing calls
no test coverage detected