GraphEdge (int nodeIndex, @Nullable Integer targetId, @NotNull GraphEdgeType type) { return switch (type) { case DOTTED_ARROW_UP -> new GraphEdge(null, nodeIndex, targetId, type); case NOT_LOAD_COMMIT, DOTTED_ARROW_DOWN -> new GraphEdge(nodeIndex, null, targetId, type); default -> throw new AssertionError("Unexpected edge type: " + type); }; }