class ScenarioExtractorUtil {

    public static String removeFunctionalitiesFromScenarioCucumberId(String cucumberId) {
        if (cucumberId != null) {
            final Matcher matcher = FUNCTIONALITY_PATTERN_ON_ID.matcher(cucumberId);
            if (matcher.matches()) {
                int startIndex = matcher.start(1);
                int stopIndex = matcher.end(1);
                if (startIndex > 0 && startIndex == cucumberId.indexOf(';') && stopIndex < cucumberId.length()) {
                    return cucumberId.substring(0, startIndex) + ";" + cucumberId.substring(stopIndex);
                }
            }
        }
        return cucumberId;
    }

}