@Override
    @SuppressWarnings("unchecked")
    public void run(DiagnosticsLogWriter writer) {
        writer.startSection("SystemProperties");

        keys.clear();
        keys.addAll(System.getProperties().keySet());
        keys.add(JVM_ARGS);
        sort(keys);

        for (Object key : keys) {
            String keyString = (String) key;
            if (isIgnored(keyString)) {
                continue;
            }

            String value = getProperty(keyString);
            writer.writeKeyValueEntry(keyString, value);
        }
        writer.endSection();
    }
@Test
    public void testRun() {
        plugin.run(logWriter);

        Properties systemProperties = System.getProperties();

        // we check a few of the regular ones
        assertContains("java.class.version=" + systemProperties.get("java.class.version"));
        assertContains("java.class.path=" + systemProperties.get("java.class.path"));

        // we want to make sure the hazelcast system properties are added
        assertContains(FAKE_PROPERTY + "=" + FAKE_PROPERTY_VALUE);

        // java.vm.args doesn't work under windows
        // https://github.com/hazelcast/hazelcast/issues/11610
        assertContains(SystemPropertiesPlugin.JVM_ARGS + "=");

        // we don't want to have awt
        assertNotContains("java.awt");
    }