class HgNodePartitionerBuilder {

    private Set<HgNodePartition> partitions = null;

    static HgNodePartitionerBuilder resetAndGet() {
        return new HgNodePartitionerBuilder();
    }

    /**
     * @param nodeId
     * @param keyCode
     * @return
     * @see HgNodePartitionerBuilder:setPartitions(Set<HgNodePartition> partitions)
     */
    @Deprecated
    public HgNodePartitionerBuilder add(Long nodeId, Integer keyCode) {<FILL_FUNCTION_BODY>}

    Collection<HgNodePartition> getPartitions() {
        return this.partitions;
    }

    public void setPartitions(Set<HgNodePartition> partitions) {
        isFalse(partitions == null, "The argument is invalid: partitions");
        this.partitions = partitions;
    }

}

        isFalse(nodeId == null, "The argument is invalid: nodeId");
        isFalse(keyCode == null, "The argument is invalid: keyCode");

        if (this.partitions == null) {
            this.partitions = new HashSet<>(16, 1);
        }

        this.partitions.add(HgNodePartition.of(nodeId, keyCode));
        return this;
    
<no_super_class>