if (entity instanceof Tank && (entity.getMovementMode() == IEntityMovementMode.TRACKED || entity.getMovementMode() == IEntityMovementMode.WHEELED ) && game.getBoard().getHex(entity.getPosition()).terrainLevel(Terrains.WATER) > 0) {
if (entity instanceof Tank && (entity.getPosition() != null) && (entity.getMovementMode() == IEntityMovementMode.TRACKED || entity.getMovementMode() == IEntityMovementMode.WHEELED ) && game.getBoard().getHex(entity.getPosition()).terrainLevel(Terrains.WATER) > 0) {
            public boolean accept(Entity entity) {                if (entity.isOffBoard()) {                    return false;                }                // TODO : correctly handle bridges.                if (entity instanceof Tank &&                    (entity.getMovementMode() == IEntityMovementMode.TRACKED ||                     entity.getMovementMode() == IEntityMovementMode.WHEELED ) &&                    game.getBoard().getHex(entity.getPosition()).terrainLevel(Terrains.WATER) > 0) {                        return true;                }                return false;            }