private int getInstanceWantedPort(int userWantedPort) {
        int wantedPort = 0;
        if (userWantedPort == 0) {
            if (requiresWantedPort())
                wantedPort = getWantedPort();
            else if (getWantedPort() > 0)
                wantedPort = getWantedPort() + ((getId() - 1) * getPortCount());
        } else {
            // User defined from spec
            wantedPort = userWantedPort;
        }
        return wantedPort;
    }
Returns the desired base port for this service instance, '0' if
it should use the default port allocation mechanism.

@param userWantedPort The wanted port given by the user.
@return The desired base port for this service instance, '0' by default
config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java