class Strings {

    public static String abbreviatePrefix(String str, int prefixLength, int length, String abrevMarker) {
        if (isEmpty(str) || isEmpty(abrevMarker)) {
            return str;
        }

        if (length >= str.length() || prefixLength > str.length()) {
            return str;
        }

        int fullPrefixLength = prefixLength + abrevMarker.length();

        StringBuilder builder = new StringBuilder(length);
        builder.append(str.substring(0, prefixLength));
        builder.append(abrevMarker);

        if(fullPrefixLength < length) {
            int startOffset = str.length() - length + fullPrefixLength;
            builder.append(str.substring(startOffset));
        }

        return builder.toString();
    }

    protected  Strings();

}