presto-spi/src/main/java/io/prestosql/spi/connector/ConnectorBucketNodeMap.java/ConnectorBucketNodeMap/ConnectorBucketNodeMap
class ConnectorBucketNodeMap:    private ConnectorBucketNodeMap(int bucketCount, Optional<List<Node>> bucketToNode)
    {
        if (bucketCount <= 0) {
            throw new IllegalArgumentException("bucketCount must be positive");
        }
        if (bucketToNode.isPresent() && bucketToNode.get().size() != bucketCount) {
            throw new IllegalArgumentException(format("Mismatched bucket count in bucketToNode (%s) and bucketCount (%s)", bucketToNode.get().size(), bucketCount));
        }
        this.bucketCount = bucketCount;
        this.bucketToNode = bucketToNode.map(ArrayList::new).map(Collections::unmodifiableList);
    }