на ревью кода жабская многословность работает в плюс. не надо смотреть весь модуль, достаточно изменённый метод прочитать. контекст обычно целиком в нём.
в скала то же самое, вот сейчас перед глазами код с StandfordNLP
public DirectedMultiGraph(DirectedMultiGraph<V,E> graph) {
this(graph.outerMapFactory, graph.innerMapFactory);
for (Map.Entry<V, Map<V, List<E>>> map : graph.outgoingEdges.entrySet()) {
Map<V, List<E>> edgesCopy = innerMapFactory.newMap();
for (Map.Entry<V, List<E>> entry : map.getValue().entrySet()) {
edgesCopy.put(entry.getKey(), Generics.newArrayList(entry.getValue()));
}
this.outgoingEdges.put(map.getKey(), edgesCopy);
}
for (Map.Entry<V, Map<V, List<E>>> map : graph.incomingEdges.entrySet()) {
Map<V, List<E>> edgesCopy = innerMapFactory.newMap();
for (Map.Entry<V, List<E>> entry : map.getValue().entrySet()) {
edgesCopy.put(entry.getKey(), Generics.newArrayList(entry.getValue()));
}
this.incomingEdges.put(map.getKey(), edgesCopy);
}
}
если бы не комментарий к началу, вообще сложно продраться что делается в нем