//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testEqualsAndHashCode()
        public virtual void testEqualsAndHashCode()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] residuals = new double[] {1, 2, 3 };
            double[] residuals = new double[] { 1, 2, 3 };
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] betas = new double[] {1.1, 2.1, 3.1 };
            double[]     betas           = new double[] { 1.1, 2.1, 3.1 };
            const double meanSquareError = 0.78;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] standardErrorOfBeta = new double[] {1.2, 2.2, 3.2 };
            double[]     standardErrorOfBeta = new double[] { 1.2, 2.2, 3.2 };
            const double rSquared            = 0.98;
            const double rSquaredAdjusted    = 0.96;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] tStats = new double[] {1.3, 2.3, 3.3 };
            double[] tStats = new double[] { 1.3, 2.3, 3.3 };
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] pValues = new double[] {1.4, 2.4, 3.4 };
            double[]   pValues      = new double[] { 1.4, 2.4, 3.4 };
            const bool hasIntercept = false;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final LeastSquaresRegressionResult result = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            LeastSquaresRegressionResult result = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            LeastSquaresRegressionResult other  = new LeastSquaresRegressionResult(result);

            assertEquals(result, other);
            assertEquals(result.GetHashCode(), other.GetHashCode());
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertEquals(result, other);
            assertEquals(result.GetHashCode(), other.GetHashCode());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double[] x = new double[] {1.5, 2.5, 3.5 };
            double[] x = new double[] { 1.5, 2.5, 3.5 };
            other = new LeastSquaresRegressionResult(x, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, x, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError + 1, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, x, rSquared, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared + 1, rSquaredAdjusted, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted + 1, tStats, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, x, pValues, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, x, hasIntercept);
            assertFalse(result.Equals(other));
            other = new LeastSquaresRegressionResult(betas, residuals, meanSquareError, standardErrorOfBeta, rSquared, rSquaredAdjusted, tStats, pValues, !hasIntercept);
            assertFalse(result.Equals(other));
        }
        public override int GetHashCode()
        {
            int prime  = 31;
            int result = base.GetHashCode();

            result = prime * result + (_independentVariableNames == null ? 0 : _independentVariableNames.GetHashCode());
            result = prime * result + (_result == null ? 0 : _result.GetHashCode());
            return(result);
        }