class NamesProviderImpl implements NamesProvider {

    @NotNull
    @Override
    public String buildMessageName(@NotNull String methodName) {
        StringBuilder name = new StringBuilder(StringUtils.capitalize(methodName));
        name.append("Message");
        final int length = name.length();
        int index = 0;
        while (mUsed.contains(name)) {
            name.setLength(length);
            name.append(++index);
        }

        String result = name.toString();
        mUsed.add(result);
        return result;
    }

}