ContinuedFraction { public double evaluate(double x) throws ConvergenceException { return evaluate(x, DEFAULT_EPSILON, Integer.MAX_VALUE); } protected  ContinuedFraction(); double evaluate(double x); double evaluate(double x, double epsilon); double evaluate(double x, int maxIterations); double evaluate(double x, double epsilon, int maxIterations);  }
@Test public void testGoldenRatio() throws Exception { ContinuedFraction cf = new ContinuedFraction() { @Override public double getA(int n, double x) { return 1.0; } @Override public double getB(int n, double x) { return 1.0; } }; double gr = cf.evaluate(0.0, 10e-9); Assert.assertEquals(1.61803399, gr, 10e-9); }