class CompositeAdjacencyList implements AdjacencyList {

    @Override
    public int degree(long nodeId) {
        long degree = 0L;
        for (int i = 0; i < adjacencyLists.size(); i++) {
            long offset = adjacencyOffsets.get(i).get(nodeId);
            if (offset != 0) {
                degree += adjacencyLists.get(i).degree(offset);
            }
        }
        return Math.toIntExact(degree);
    }

      CompositeAdjacencyList(List<AdjacencyList> adjacencyLists, List<AdjacencyOffsets> adjacencyOffsets);

}