protected PathNode findNavalTarget(final int maxTurns) {
        if (!getUnit().isOffensiveUnit()) {
            throw new IllegalStateException("A target can only be found for offensive units. You tried with: "
                                            + getUnit().toString());
        }
        if (!getUnit().isNaval()) {
            throw new IllegalStateException("A target can only be found for naval units. You tried with: "
                                            + getUnit().toString());
        }

        final GoalDecider gd = new GoalDecider() {
                private PathNode bestTarget = null;
                private int bestValue = 0;

                public PathNode getGoal() {
                    return bestTarget;
                }

                public boolean hasSubGoals() {
                    return true;
                }

                public boolean check(final Unit unit, final PathNode pathNode) {
                    final Tile newTile = pathNode.getTile();
                    if (newTile == null) return false;
                    final Unit defender = newTile.getDefendingUnit(unit);
                    if (newTile.isLand()
                        || defender == null
                        || defender.getOwner() == unit.getOwner()) {
                        return false;
                    }
                    if (!canAttackPlayer(defender.getOwner())) {
                        return false;
                    }
                    final int value = 1 + defender.getCargoSpaceTaken();
                    if (value > bestValue) {
                        bestTarget = pathNode;
                        bestValue = value;
                    }
                    return true;
                }
            };
        return getUnit().search(getUnit().getTile(), gd,
                                CostDeciders.avoidSettlements(),
                                maxTurns, null);
    }