private static KeyValue[] toKeyValueArray(final Map<String, String> values) {
        return values
            .entrySet()
            .stream()
            .filter(entry -> StringUtils.isNotBlank(entry.getValue()))
            .map(entry -> KeyValue.of(entry.getKey(), entry.getValue()))
            .toList()
            .toArray(EMPTY_KEY_VALUES_ARRAY);
    }
This is {@link DefaultExecutableObserver}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-monitor/src/main/java/org/apereo/cas/monitor/DefaultExecutableObserver.java