class TextUtils {

    public static String truncateByDoubleColons(String source, int level) {
        if (isEmpty(source)) {
            return source;
        }
        if (level <= 0) {
            throw new IllegalArgumentException("Level must be larger than 0");
        }
        List<String> original = Arrays.asList(source.split("::"));
        if (original.size() <= level) {
            return source;
        }
        List<String> result = original.subList(level, original.size());
        return join("::", result.toArray(new String[0]));
    }

}