### Question:
LeastSquareResults { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } LeastSquareResults other = (LeastSquareResults) obj; if (Double.doubleToLongBits(_chiSq) != Double.doubleToLongBits(other._chiSq)) { return false; } if (!Objects.equals(_covariance, other._covariance)) { return false; } if (!Objects.equals(_inverseJacobian, other._inverseJacobian)) { return false; } return Objects.equals(_parameters, other._parameters); } LeastSquareResults(LeastSquareResults from);  LeastSquareResults(double chiSq, DoubleArray parameters, DoubleMatrix covariance);  LeastSquareResults(
      double chiSq,
      DoubleArray parameters,
      DoubleMatrix covariance,
      DoubleMatrix inverseJacobian); double getChiSq(); DoubleArray getFitParameters(); DoubleMatrix getCovariance(); DoubleMatrix getFittingParameterSensitivityToData(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals() { LeastSquareResults ls1 = new LeastSquareResults(1.0, PARAMS, COVAR); LeastSquareResults ls2 = new LeastSquareResults(1.0, DoubleArray.of(1.0, 2.0), DoubleMatrix.copyOf(new double[][] {{0.1, 0.2}, {0.2, 0.3}})); assertThat(ls1).isEqualTo(ls2); ls2 = new LeastSquareResults(1.0, PARAMS, COVAR, null); assertThat(ls1).isEqualTo(ls2); ls2 = new LeastSquareResults(1.1, PARAMS, COVAR); assertThat(ls1.equals(ls2)).isFalse(); ls2 = new LeastSquareResults(1.0, DoubleArray.of(1.1, 2.0), DoubleMatrix.copyOf(new double[][] { {0.1, 0.2}, {0.2, 0.3}})); assertThat(ls1.equals(ls2)).isFalse(); ls2 = new LeastSquareResults(1.0, DoubleArray.of(1.0, 2.0), DoubleMatrix.copyOf(new double[][] { {0.1, 0.2}, {0.2, 0.4}})); assertThat(ls1.equals(ls2)).isFalse(); ls2 = new LeastSquareResults(1.0, PARAMS, COVAR, INV_JAC); assertThat(ls1.equals(ls2)).isFalse(); ls1 = new LeastSquareResults(1, PARAMS, COVAR, INV_JAC); ls2 = new LeastSquareResults(1, PARAMS, COVAR, COVAR); assertThat(ls1.equals(ls2)).isFalse(); }