@VisibleForTesting
    static Pattern convertToPattern(String scopeOrNameComponent) {
        final String[] split = scopeOrNameComponent.split(LIST_DELIMITER);

        final String rawPattern =
                Arrays.stream(split)
                        .map(s -> s.replaceAll("\\.", "\\."))
                        .map(s -> s.replaceAll("\\*", ".*"))
                        .collect(Collectors.joining("|", "(", ")"));

        return Pattern.compile(rawPattern);
    }
@Test
    void testConvertToPatternMultiple() {
        final Pattern pattern = DefaultMetricFilter.convertToPattern("numRecords*,numBytes*");
        assertThat(pattern.toString()).isEqualTo("(numRecords.*|numBytes.*)");
        assertThat(pattern.matcher("numRecordsIn").matches()).isTrue();
        assertThat(pattern.matcher("numBytesOut").matches()).isTrue();
        assertThat(pattern.matcher("numBytes").matches()).isTrue();
        assertThat(pattern.matcher("hello").matches()).isFalse();
    }