static String findParentHost(String nodeName) {
        if (expectedNodeName1.matcher(nodeName).matches()) {
            return replaceNodeName1.matcher(nodeName).replaceFirst(".");
        }
        if (expectedNodeName2.matcher(nodeName).matches()) {
            return replaceNodeName2.matcher(nodeName).replaceFirst(".");
        }
        return null;
    }
@Test
    void testFindParentHost() {
        String result;
        result = OpenTelemetryConfigGenerator.findParentHost("n1234c.foo.bar.some.cloud");
        assertEquals("n1234.foo.bar.some.cloud", result);
        result = OpenTelemetryConfigGenerator.findParentHost("n1234-v6-7.foo.bar.some.cloud");
        assertEquals("n1234.foo.bar.some.cloud", result);
        result = OpenTelemetryConfigGenerator.findParentHost("2000a.foo.bar.some.cloud");
        assertEquals("2000.foo.bar.some.cloud", result);
        result = OpenTelemetryConfigGenerator.findParentHost("2000-v6-10.foo.bar.some.cloud");
        assertEquals("2000.foo.bar.some.cloud", result);
        result = OpenTelemetryConfigGenerator.findParentHost("foobar.some.cloud");
        assertNull(result);
        result = OpenTelemetryConfigGenerator.findParentHost("foo123bar.some.cloud");
        assertNull(result);
        result = OpenTelemetryConfigGenerator.findParentHost("foo123.some.cloud");
        assertNull(result);
    }