public static String concatenateUsingStringBuffer(String[] stringArray, String delimiter) {

        if (delimiter == null || stringArray == null || stringArray.length == 0) {
            return null;
        }

        StringBuffer result = new StringBuffer().append(stringArray[0]);

        for (int i = 1; i < stringArray.length ;i++) {
            result.append(delimiter).append(stringArray[i]);

        }

        return result.toString();
    }