static List<Mass> parseMasses(String line) {
        Matcher matcher = COORDINATES_PATTERN.matcher(line);
        ArrayList<Mass> masses = new ArrayList<>();

        if (!matcher.find()) {
            return masses;
        }

        Type typeOfMass = getTypeForKeyword(getKeywordOfLine(line));
        String[] coordinates = matcher.group(0).split("[ \t]");

        for (int i = 1; i < coordinates.length; i += 2) {
            String x = coordinates[i];
            String y = coordinates[i + 1];
            masses.add(new Mass(Double.parseDouble(x), Double.parseDouble(y), typeOfMass));
        }

        return masses;
    }