class GroupGenerator {
    private static final Logger LOG = LoggerFactory.getLogger(GroupGenerator.class);

    @Autowired
    private ApplicationContext applicationContext;

    private Integer generatorLength;
    private String generatorCharacter;
    private String applicationName;

    private String group;

    @PostConstruct
    public void initialize() {<FILL_FUNCTION_BODY>}

    public Integer getGeneratorLength() {
        return generatorLength;
    }

    public String getGeneratorCharacter() {
        return generatorCharacter;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public String getGroup() {
        return group;
    }
}

        generatorLength = PluginContextAware.getGroupGeneratorLength(applicationContext.getEnvironment());
        generatorCharacter = PluginContextAware.getGroupGeneratorCharacter(applicationContext.getEnvironment());
        applicationName = PluginContextAware.getApplicationName(applicationContext.getEnvironment());
        int characterIndex = applicationName.indexOf(generatorCharacter);

        if (generatorLength > 0) {
            group = applicationName.substring(0, generatorLength);
        } else if (StringUtils.isNotEmpty(generatorCharacter) && characterIndex > 0) {
            group = applicationName.substring(0, characterIndex);
        }

        LOG.info("--------------------------------------------------");
        if (StringUtils.isNotEmpty(group)) {
            LOG.info("Use application name prefix={} as metadata group", group);
        } else {
            LOG.error("Not substring application name prefix for generator length={} or character={}, use default metadata group setting", generatorLength, generatorCharacter);
        }
        LOG.info("--------------------------------------------------");
    
<no_super_class>