<commit_before>package pl.grzeslowski.jsupla;

import java.util.Collection;

import static java.lang.String.format;

public final class Preconditions {
    public static int min(int value, int min) {
        if (value < min) {
            throw new IllegalArgumentException(format("Given value %s is smaller than minimal value %s!", value, min));
        }
        return value;
    }

    public static int max(int value, int max) {
        if (value > max) {
            throw new IllegalArgumentException(format("Given value %s is bigger than maximal value %s!", value, max));
        }
        return value;
    }

    public static int size(int value, int min, int max) {
        return max(min(value, min), max);
    }

    public static <T> Collection<T> size(Collection<T> collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T extends CharSequence> T size(T collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T> T[] size(T[] collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T> byte[] size(byte[] collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T> Collection<T> sizeMax(Collection<T> collection, int max) {
        final int size = collection.size();
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T extends CharSequence> T sizeMax(T collection, int max) {
        final int size = collection.length();
        if (size > max) {
            throw new IllegalArgumentException(format("CharSequence size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T> T[] sizeMax(T[] collection, int max) {
        final int size = collection.length;
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T> byte[] sizeMax(byte[] collection, int max) {
        final int size = collection.length;
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T> Collection<T> sizeMin(Collection<T> collection, int min) {
        final int size = collection.size();
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static <T extends CharSequence> T sizeMin(T collection, int min) {
        final int size = collection.length();
        if (size < min) {
            throw new IllegalArgumentException(format("CharSequence size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static <T> T[] sizeMin(T[] collection, int min) {
        final int size = collection.length;
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static <T> byte[] sizeMin(byte[] collection, int min) {
        final int size = collection.length;
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;<commit_msg>Removing not used type T<commit_after>package pl.grzeslowski.jsupla;

import java.util.Collection;

import static java.lang.String.format;

public final class Preconditions {
    public static int min(int value, int min) {
        if (value < min) {
            throw new IllegalArgumentException(format("Given value %s is smaller than minimal value %s!", value, min));
        }
        return value;
    }

    public static int max(int value, int max) {
        if (value > max) {
            throw new IllegalArgumentException(format("Given value %s is bigger than maximal value %s!", value, max));
        }
        return value;
    }

    public static int size(int value, int min, int max) {
        return max(min(value, min), max);
    }

    public static <T> Collection<T> size(Collection<T> collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T extends CharSequence> T size(T collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T> T[] size(T[] collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static byte[] size(byte[] collection, int min, int max) {
        return sizeMax(sizeMin(collection, min), max);
    }

    public static <T> Collection<T> sizeMax(Collection<T> collection, int max) {
        final int size = collection.size();
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T extends CharSequence> T sizeMax(T collection, int max) {
        final int size = collection.length();
        if (size > max) {
            throw new IllegalArgumentException(format("CharSequence size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T> T[] sizeMax(T[] collection, int max) {
        final int size = collection.length;
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static byte[] sizeMax(byte[] collection, int max) {
        final int size = collection.length;
        if (size > max) {
            throw new IllegalArgumentException(format("Collection size %s is too big, max %s!", size, max));
        }
        return collection;
    }

    public static <T> Collection<T> sizeMin(Collection<T> collection, int min) {
        final int size = collection.size();
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static <T extends CharSequence> T sizeMin(T collection, int min) {
        final int size = collection.length();
        if (size < min) {
            throw new IllegalArgumentException(format("CharSequence size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static <T> T[] sizeMin(T[] collection, int min) {
        final int size = collection.length;
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;
    }

    public static byte[] sizeMin(byte[] collection, int min) {
        final int size = collection.length;
        if (size < min) {
            throw new IllegalArgumentException(format("Collection size %s is too small, min %s!", size, min));
        }
        return collection;
{'fraction_non_alphanumeric': 0.110580204778157, 'fraction_numerical': 0.0, 'mean_word_length': 2.4952290076335877, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, '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': '4225935', 'n_tokens_mistral': 1999, 'n_tokens_neox': 1965, 'n_words': 736}