class DocumentDownloadLinkGenerator {

    public static String generateDownloadLink(String serverTemplateId,
                                              String documentIdentifier) {
        if (serverTemplateId == null) {
            throw new IllegalArgumentException("ServerTemplateId cannot be null");
        }

        if (documentIdentifier == null) {
            throw new IllegalArgumentException("DocumentIdentifier cannot be null");
        }
        return PATTERN.replace(TEMPLATE_ID_TOKEN,
                               serverTemplateId).replace(DOCUMENT_ID_TOKEN,
                                                         documentIdentifier);
    }

}