@Test public void testEquals() { Assert.assertTrue(this.tileId.equals(this.tileId)); Assert.assertFalse(this.tileId.equals(null)); Assert.assertFalse(this.tileId.equals("Blah")); TileIdentifier otherTile = createTestTileIdentifier(5, 10, 12, "SomeService"); Assert.assertTrue(this.tileId.equals(otherTile)); Assert.assertTrue(otherTile.equals(this.tileId)); }
public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof TileIdentifier)) { return false; } return this.getId().equals(((TileIdentifier) other).getId()); }
TileIdentifier { public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof TileIdentifier)) { return false; } return this.getId().equals(((TileIdentifier) other).getId()); } }
TileIdentifier { public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof TileIdentifier)) { return false; } return this.getId().equals(((TileIdentifier) other).getId()); } TileIdentifier(int x, int y, ZoomLevel zoomLevel, String serviceName); }
TileIdentifier { public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof TileIdentifier)) { return false; } return this.getId().equals(((TileIdentifier) other).getId()); } TileIdentifier(int x, int y, ZoomLevel zoomLevel, String serviceName); int getZ(); int getX(); int getY(); ZoomLevel getZoomLevel(); String getServiceName(); static final int arithmeticMod(int a, int b); boolean equals(Object other); int hashCode(); String toString(); abstract String getId(); abstract String getCode(); abstract TileIdentifier getRightNeighbour(); abstract TileIdentifier getLowerNeighbour(); }
TileIdentifier { public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof TileIdentifier)) { return false; } return this.getId().equals(((TileIdentifier) other).getId()); } TileIdentifier(int x, int y, ZoomLevel zoomLevel, String serviceName); int getZ(); int getX(); int getY(); ZoomLevel getZoomLevel(); String getServiceName(); static final int arithmeticMod(int a, int b); boolean equals(Object other); int hashCode(); String toString(); abstract String getId(); abstract String getCode(); abstract TileIdentifier getRightNeighbour(); abstract TileIdentifier getLowerNeighbour();  }