class UrlHelper {

    public static String makeFullUrl(String pageUrl, String baseUrl, String linkUrl) {
        if (linkUrl == null) {
            throw new NullPointerException("linkUrl must not be null");
        }
        if (baseUrl != null && !baseUrl.endsWith("/")) {
            baseUrl = baseUrl.concat("/");
        }
        String contextUrl;
        if (pageUrl != null && baseUrl != null) {
            contextUrl = makeFullUrl(pageUrl, baseUrl);
        } else if (pageUrl != null) {
            contextUrl = pageUrl;
        } else {
            contextUrl = baseUrl;
        }
        return makeFullUrl(contextUrl, linkUrl);
    }

    private  UrlHelper();

}