import java.util.*; public class Move { private Velocity velocity; private Map.Entry<Double, Double> move; public Move(Velocity velocity) { this.velocity = velocity; } public void moveY(double y) { this.move = new AbstractMap.SimpleEntry<>(this.move.getKey(), y); velocity.setMove(move); velocity.updateMove(); } public void moveX(double x) { this.move = new AbstractMap.SimpleEntry<>(x, this.move.getValue()); } public Map.Entry<Double, Double> getMove() { return move; } }