Just have an interface, for example Coordinate2D, which defines 2 methods: getX() and getY(). The user would only need to make his data structure implement this interface, or build a wrapper around...