hollow/src/main/java/com/netflix/hollow/tools/combine/HollowCombiner.java
public void setPrimaryKeys(PrimaryKey... newKeys) {
        Objects.requireNonNull(newKeys);
        if (newKeys.length == 0) {
            return;
        }

        if (inputs.length == 1) {
            return;
        }

        /// deduplicate new keys with existing keys
        //process existing ones first
        Map<String, PrimaryKey> keysByType = new HashMap<>();
        for (PrimaryKey primaryKey : primaryKeys) {
            keysByType.put(primaryKey.getType(), primaryKey);
        }

        // allow override
        for (PrimaryKey primaryKey : newKeys) {
            keysByType.put(primaryKey.getType(), primaryKey);
        }

        this.primaryKeys = sortPrimaryKeys(new ArrayList<>(keysByType.values()));
    }
public void setPrimaryKeys(PrimaryKey... newKeys) {
        Objects.requireNonNull(newKeys);
        if (newKeys.length == 0) {
            return;
        }

        if (inputs.length == 1) {
            return;
        }

        /// deduplicate new keys with existing keys
        //process existing ones first
        Map<String, PrimaryKey> keysByType = new HashMap<>();
        for (PrimaryKey primaryKey : primaryKeys) {
            keysByType.put(primaryKey.getType(), primaryKey);
        }

        // allow override
        for (PrimaryKey primaryKey : newKeys) {
            keysByType.put(primaryKey.getType(), primaryKey);
        }

        this.primaryKeys = sortPrimaryKeys(new ArrayList<>(keysByType.values()));
    }
public void setPrimaryKeys ( PrimaryKey ... newKeys ) { Objects . requireNonNull ( newKeys ) ; if ( newKeys . length == 0 ) { return ; } if ( inputs . length == 1 ) { return ; } /// deduplicate new keys with existing keys //process existing ones first Map < String , PrimaryKey > keysByType = new HashMap <> ( ) ; for ( PrimaryKey primaryKey : primaryKeys ) { keysByType . put ( primaryKey . getType ( ) , primaryKey ) ; } // allow override for ( PrimaryKey primaryKey : newKeys ) { keysByType . put ( primaryKey . getType ( ) , primaryKey ) ; } this . primaryKeys = sortPrimaryKeys ( new ArrayList <> ( keysByType . values ( ) ) ) ; }
When provided, a set of {@link PrimaryKey} will ensure that no duplicate records are added to the destination state.

If multiple records exist in the inputs matching a single value for any of the supplied primary keys, then only one such record
will be copied to the destination.  The specific record which is copied will be the record from the input which was supplied first in the constructor
of this HollowCombiner.

Further, if any record <i>references</i> another record which was omitted because it would have been duplicate based on this rule, then that reference is
remapped in the destination state to the matching record which was chosen to be included.

@param newKeys the new primary keys
When provided a set of { @link PrimaryKey } will ensure that no duplicate records are added to the destination state .