<commit_before>/*
 * The Spring Framework is published under the terms of the Apache Software
 * License.
 */
package org.springframework.util;

import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Generic, immutable composite key class. Useful for storing a structure of
 * unique objects as a unified key in a Map.
 * 
 * Backed by a LinkedHashSet, a JDK 1.4 class that guarantees predictable
 * insertion based iteration order. Objects participating in the key should
 * implement equals and hashCode.
 * 
 * @author <NAME>
 */
public class CompositeKey {
    private Set parts;

    /**
     * Creates a CompositeKey from the set of individual keys.
     * 
     * @param parts
     *            The set of key parts.
     * @throws IllegalArgumentException
     *             if the set is null or has less than 2 elements.
     */
    public CompositeKey(Set parts) {
        Assert.notNull(parts);
        Assert.isTrue(
            parts.size() > 1,
            "A composite key by definition has more than one key.");
        this.parts = new LinkedHashSet(parts);
    }

    /**
     * Creates a CompositeKey with two key parts.
     * 
     * @param part1
     * @param part2
     */
    public CompositeKey(Object part1, Object part2) {
        this.parts = new LinkedHashSet(2);
        parts.add(part1);<commit_msg>set constructor doesn't make sense<commit_after>/*
 * The Spring Framework is published under the terms of the Apache Software
 * License.
 */
package org.springframework.util;

import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Generic, immutable composite key class. Useful for storing a structure of
 * unique objects as a unified key in a Map.
 * 
 * Backed by a LinkedHashSet, a JDK 1.4 class that guarantees predictable
 * insertion based iteration order. Objects participating in the key should
 * implement equals and hashCode.
 * 
 * @author <NAME>
 */
public class CompositeKey {
    private Set parts;

    /**
     * Creates a CompositeKey with two key parts.
     * 
     * @param part1
     * @param part2
     */
    public CompositeKey(Object part1, Object part2) {
        this.parts = new LinkedHashSet(2);
        parts.add(part1);
{'fraction_non_alphanumeric': 0.08329718004338395, 'fraction_numerical': 0.0078091106290672455, 'mean_word_length': 2.6955128205128207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5896588', 'n_tokens_mistral': 658, 'n_tokens_neox': 626, 'n_words': 246}