import java.util.*; public class Force { private Acceleration acceleration; private Map.Entry<Double, Double> value; public Force(Acceleration acceleration) { this.acceleration = acceleration; } public void gravity(double y) { this.value = new AbstractMap.SimpleEntry<>(0.0, y); acceleration.updateByForce(value); } public Map.Entry<Double, Double> getValue() { return value; } }