### Question:
Tree { public static double logSumExp(double a, double b) { double max = Math.max(a, b); return max + Math.log(Math.exp(a - max) + Math.exp(b - max)); } Tree(LeapfrogState startState,
                Proposal proposal,
                double maxEnergyChange,
                ProbabilisticModelWithGradient logProbGradientCalculator,
                LeapfrogIntegrator leapfrogIntegrator,
                List<? extends Variable> sampleFromVariables,
                KeanuRandom random); void grow(int buildDirection,
                     double timeStep); static double logSumExp(double a, double b); boolean shouldContinue(); void save(Statistics statistics);  }### Answer:
@Test public void canLogSumExp() { double a = -0.25; double b = 0.5; double expected = Math.log(Math.exp(a) + Math.exp(b)); double actual = Tree.logSumExp(a, b); assertEquals(expected, actual, 1e-6); }