HexPosition { public int calcDistance(final HexPosition pos){ return this.calcDistance(pos.getColumn(), pos.getRow()); } HexPosition(final int column, final int row); int getColumn(); int getRow(); boolean isAtModel(final HexEngineModel<?> model); @Override int hashCode(); @Override boolean equals(final Object object); int calcDistance(final HexPosition pos); int calcDistance(final int col, final int row); static int calcDistance(final int col1, final int row1, final int col2, final int row2); static int calcDistance(final HexPosition pos1, final HexPosition pos2); @Override String toString();  }
@Test public void testCalcDistance(){ final HexPosition base = new HexPosition(10,10); assertEquals(0,base.calcDistance(base)); assertEquals(1,base.calcDistance(new HexPosition(11, 10))); assertEquals(1,base.calcDistance(new HexPosition(11, 11))); assertEquals(1,base.calcDistance(new HexPosition(10, 11))); assertEquals(14,base.calcDistance(new HexPosition(0, 0))); }