Buggy code:
public class LeastSquaresFactory { private LeastSquaresFactory ( ) { } public static LeastSquaresProblem create ( final MultivariateJacobianFunction model , final RealVector observed , final RealVector start , final RealMatrix weight , final ConvergenceChecker < Evaluation > checker , final int maxEvaluations , final int maxIterations , final boolean lazyEvaluation , final ParameterValidator paramValidator ) { } public static LeastSquaresProblem create ( final MultivariateJacobianFunction model , final RealVector observed , final RealVector start , final ConvergenceChecker < Evaluation > checker , final int maxEvaluations , final int maxIterations ) { } public static LeastSquaresProblem create ( final MultivariateJacobianFunction model , final RealVector observed , final RealVector start , final RealMatrix weight , final ConvergenceChecker < Evaluation > checker , final int maxEvaluations , final int maxIterations ) { } public static LeastSquaresProblem create ( final MultivariateVectorFunction model , final MultivariateMatrixFunction jacobian , final double [ ] observed , final double [ ] start , final RealMatrix weight , final ConvergenceChecker < Evaluation > checker , final int maxEvaluations , final int maxIterations ) { } public static LeastSquaresProblem weightMatrix ( final LeastSquaresProblem problem , final RealMatrix weights ) { } public static LeastSquaresProblem weightDiagonal ( final LeastSquaresProblem problem , final RealVector weights ) { } public static LeastSquaresProblem countEvaluations ( final LeastSquaresProblem problem , final Incrementor counter ) { } public static ConvergenceChecker < Evaluation > evaluationChecker ( final ConvergenceChecker < PointVectorValuePair > checker ) { } private static RealMatrix squareRoot ( final RealMatrix m ) { } <START_BUG> public static ValueAndJacobianFunction model ( final MultivariateVectorFunction value , final MultivariateMatrixFunction jacobian ) { <END_BUG> return new LeastSquaresFactory . LocalValueAndJacobianFunction ( value , jacobian ) ; } private static class LocalValueAndJacobianFunction implements ValueAndJacobianFunction { private final MultivariateVectorFunction value ; private final MultivariateMatrixFunction jacobian ; LocalValueAndJacobianFunction ( final MultivariateVectorFunction value , final MultivariateMatrixFunction jacobian ) { } public Pair < RealVector , RealMatrix > value ( final RealVector point ) { } public RealVector computeValue ( final double [ ] params ) { } public RealMatrix computeJacobian ( final double [ ] params ) { } } private static class LocalLeastSquaresProblem extends AbstractOptimizationProblem < Evaluation > implements LeastSquaresProblem { private final RealVector target ; private final MultivariateJacobianFunction model ; private final RealVector start ; private final boolean lazyEvaluation ; private final ParameterValidator paramValidator ; LocalLeastSquaresProblem ( final MultivariateJacobianFunction model , final RealVector target , final RealVector start , final ConvergenceChecker < Evaluation > checker , final int maxEvaluations , final int maxIterations , final boolean lazyEvaluation , final ParameterValidator paramValidator ) { } public int getObservationSize ( ) { } public int getParameterSize ( ) { } public RealVector getStart ( ) { } public Evaluation evaluate ( final RealVector point ) { } private static class UnweightedEvaluation extends AbstractEvaluation { private final RealVector point ; private final RealMatrix jacobian ; private final RealVector residuals ; private UnweightedEvaluation ( final RealVector values , final RealMatrix jacobian , final RealVector target , final RealVector point ) { } public RealMatrix getJacobian ( ) { } public RealVector getPoint ( ) { } public RealVector getResiduals ( ) { } } private static class LazyUnweightedEvaluation extends AbstractEvaluation { private final RealVector point ; private final ValueAndJacobianFunction model ; private final RealVector target ; private LazyUnweightedEvaluation ( final ValueAndJacobianFunction model , final RealVector target , final RealVector point ) { } public RealMatrix getJacobian ( ) { } public RealVector getPoint ( ) { } public RealVector getResiduals ( ) { } } } }

Fix:
public static MultivariateJacobianFunction model ( final MultivariateVectorFunction value , final MultivariateMatrixFunction jacobian ) {