class Collection {

    public static <T> String join(List<T> list, String separator, Function<T, String> function) {
        String result = "";
        for (int i = 0; i < list.size(); i++) {
            result += function.apply(list.get(i)).trim();
            if (i + 1 < list.size()) {
                result += separator;
            }
        }
        return result;
    }

    private  Collection();

}