class TupleUtil {

    public static boolean tuplesAreEqual(int[] parameters, int[] values,
                                         int[] otherParameters, int[] otherValues) {
        Preconditions.notNull(parameters);
        Preconditions.check(!containsDuplicates(parameters));
        Preconditions.notNull(values);
        Preconditions.check(parameters.length == values.length);
        Preconditions.notNull(otherParameters);
        Preconditions.check(!containsDuplicates(otherParameters));
        Preconditions.notNull(otherValues);
        Preconditions.check(otherParameters.length == otherValues.length);

        if(parameters.length != otherParameters.length) {
            return false;
        }

        for(int i = 0; i < parameters.length; i++) {
            final int parameter = parameters[i];
            final int value = values[i];

            final OptionalInt indexOfOtherParameter = ArrayUtil.indexOf(otherParameters, parameter);

            if(indexOfOtherParameter.isEmpty()) {
                return false;
            }

            final int otherValue = otherValues[indexOfOtherParameter.getAsInt()];

            if(value != otherValue) {
                return false;
            }
        }

        return true;
    }

    private  TupleUtil();

}