public static String getPartOfString(String string) throws TooShortStringException {
        if (string == null || string.isEmpty()) throw new TooShortStringException();

        int count = 0;
        for (int i = 0; i < string.length(); i++) {
            if (string.charAt(i) == ' ') {
                count++;
            }
        }

        String result = "";

        if (count < 4) {
            throw new TooShortStringException();
        } else {
            String[] mas = string.split(" ");
            for (int i = 1; i < 5; i++) {
                result += mas[i] + " ";
            }
        }
        return result;
    }