class DateTimeUtilities {

    public static String fixMillis(String dateTimeString)
    {
        String fixedString = dateTimeString;

        Matcher matcher = TOO_MANY_MILLIS_PATTERN.matcher(dateTimeString);
        if (matcher.matches())
        {
            String match = matcher.group(1);
            int millis = Integer.parseInt(match.substring(1, 5));
            millis = Math.round((float)millis / 10);
            String replacement = new StringBuilder(4).append('.').append(millis).toString();
            fixedString = Pattern.compile(match, Pattern.LITERAL).matcher(dateTimeString).replaceFirst(replacement);
        }

        return fixedString;
    }

    private  DateTimeUtilities();

}