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