import java.util.*;

/*
 * Represents a <x, y> coordinate for a piece of a wire.
 */

public class Coordinate
{
    public Coordinate (int x, int y)
    {
        _x = x;
        _y = y;
    }

    public List<Coordinate> directions ()
    {
        return List.of(new Coordinate(_x+1, _y), new Coordinate(_x-1, _y),
                        new Coordinate(_x, _y+1), new Coordinate(_x, _y-1));
    }

    public final int getX ()
    {
        return _x;
    }

    public final int getY ()
    {
        return _y;
    }

    @Override
    public String toString ()
    {
        return "<"+_x+", "+_y+">";
    }

    @Override
    public int hashCode ()
    {
        return Objects.hash(_x, _y);
    }

    @Override
    public boolean equals (Object obj)
    {
        if (obj == null)
            return false;

        if (this == obj)
            return true;
        
        if (getClass() == obj.getClass())
        {
            Coordinate temp = (Coordinate) obj;

            return ((_x == temp._x) && (_y == temp._y));
        }

        return false;
    }

    private int _x;
    private int _y;
}
@@ -508,32 +508,147 @@
 turn _y;%0A    %7D%0A%0A
+    public int distanceTo (Coordinate to)%0A    %7B%0A        return Math.abs(_x - to._x) + Math.abs(_y - to._y);%0A    %7D%0A%0A
     @Override%0A  

Update Coordinate.java