### Question:
GammaFunction implements DoubleUnaryOperator { @Override public double applyAsDouble(double x) { if (x > 0.0) { return Math.exp(Gamma.logGamma(x)); } return Math.PI / Math.sin(Math.PI * x) / applyAsDouble(1 - x); }  @Override double applyAsDouble(double x);  }### Answer:
@Test public void test() { final double x = RANDOM.nextDouble(); assertThat(Math.log(GAMMA.applyAsDouble(x))).isCloseTo(LN_GAMMA.apply(x), offset(EPS)); }