class HerdStringHelper {

    public String join(List<String> list, String delimiter, String escapeSequence)
    {
        String result = null;
        if (list != null)
        {
            List<String> filteredAndEscaped = new ArrayList<>();
            for (String element : list)
            {
                if (StringUtils.isNotBlank(element))
                {
                    element = element.replace(delimiter, escapeSequence + delimiter);
                    filteredAndEscaped.add(element);
                }
            }

            result = StringUtils.join(filteredAndEscaped, delimiter);
        }
        return result;
    }

}