@Override
    public final int hashCode() {
        int result = (enabled ? 1 : 0);
        result = 31 * result + (jmxConfig != null ? jmxConfig.hashCode() : 0);
        result = 31 * result + collectionFrequencySeconds;
        return result;
    }
@Test
    public void testCloneEquals() {
        // create MetricsConfig with non-defaults
        ClientMetricsConfig original = new ClientMetricsConfig()
                .setEnabled(false)
                .setCollectionFrequencySeconds(1);

        original.getJmxConfig()
                .setEnabled(false);

        ClientMetricsConfig clone = new ClientMetricsConfig(original);

        assertEquals(original.hashCode(), clone.hashCode());
        assertEquals(original, clone);
    }