Traversal implements Serializable { public double getDurationAccelerating() { return getDurationAt(TraversalSection::isAccelerating); } Traversal(ImmutableList<TraversalSection> sections); ImmutableList<TraversalSection> getSections(); double getTotalDuration(); double getTotalDistance(); double getDistanceAtTime(double time); double getTimeAtDistance(double distance); double getSpeedAtTime(double time); double getSpeedAtDistance(double distance); double getAccelerationAtTime(double time); double getAccelerationAtDistance(double distance); double getDurationAccelerating(); double getDurationAtConstantSpeed(); double getDurationDecelerating(); static final Traversal EMPTY_TRAVERSAL; }
@Test void getDurationAccelerating_returnsExpectedValue() { assertThat(constantAccelerationTraversal.getDurationAccelerating()).isCloseTo(2, within(0.0000001)); }