static void registerMethod(MetricsRegistry metricsRegistry, Object osBean, String methodName, String name) {
        if (OperatingSystemMXBeanSupport.GET_FREE_PHYSICAL_MEMORY_SIZE_DISABLED
                && methodName.equals("getFreePhysicalMemorySize")) {
            metricsRegistry.registerStaticProbe(osBean, name, MANDATORY, (LongProbeFunction<Object>) source -> -1);
        } else {
            registerMethod(metricsRegistry, osBean, methodName, name, 1);
        }
    }
@Test
    public void registerMethod_whenNotExist() {
        metricsRegistry = new MetricsRegistryImpl(getLogger(MetricsRegistryImpl.class), INFO);

        FakeOperatingSystemBean fakeOperatingSystemBean = new FakeOperatingSystemBean();
        registerMethod(metricsRegistry, fakeOperatingSystemBean, "notExist", "notExist");

        boolean parameterExist = metricsRegistry.getNames().contains("notExist");
        assertFalse(parameterExist);
    }