@Override
    public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }
        if((obj == null) || (obj.getClass() != this.getClass())) {
            return false;
        }
        // We know we are comparing to another SampleSaveConfiguration
        SampleSaveConfiguration s = (SampleSaveConfiguration)obj;
        boolean primitiveValues = s.time == time &&
            s.latency == latency &&
            s.connectTime == connectTime &&
            s.timestamp == timestamp &&
            s.success == success &&
            s.label == label &&
            s.code == code &&
            s.message == message &&
            s.threadName == threadName &&
            s.dataType == dataType &&
            s.encoding == encoding &&
            s.assertions == assertions &&
            s.subresults == subresults &&
            s.responseData == responseData &&
            s.samplerData == samplerData &&
            s.xml == xml &&
            s.fieldNames == fieldNames &&
            s.responseHeaders == responseHeaders &&
            s.requestHeaders == requestHeaders &&
            s.assertionsResultsToSave == assertionsResultsToSave &&
            s.saveAssertionResultsFailureMessage == saveAssertionResultsFailureMessage &&
            s.printMilliseconds == printMilliseconds &&
            s.responseDataOnError == responseDataOnError &&
            s.url == url &&
            s.bytes == bytes &&
            s.sentBytes == sentBytes &&
            s.fileName == fileName &&
            s.hostname == hostname &&
            s.sampleCount == sampleCount &&
            s.idleTime == idleTime &&
            s.threadCounts == threadCounts;

        boolean stringValues = false;
        if(primitiveValues) {
            stringValues = Objects.equals(delimiter, s.delimiter);
        }
        boolean complexValues = false;
        if(primitiveValues && stringValues) {
            complexValues = Objects.equals(dateFormat, s.dateFormat);
        }

        return primitiveValues && stringValues && complexValues;
    }
@Test
    // Checks that all the saveXX() and setXXX(boolean) methods are in the list
    public void testSaveConfigNames() throws Exception {
        List<String> getMethodNames = new ArrayList<>();
        List<String> setMethodNames = new ArrayList<>();
        Method[] methods = SampleSaveConfiguration.class.getMethods();
        for(Method method : methods) {
            String name = method.getName();
            if (name.startsWith(SampleSaveConfiguration.CONFIG_GETTER_PREFIX) && method.getParameterTypes().length == 0) {
                name = name.substring(SampleSaveConfiguration.CONFIG_GETTER_PREFIX.length());
                getMethodNames.add(name);
                assertTrue(SampleSaveConfiguration.SAVE_CONFIG_NAMES.contains(name), "SAVE_CONFIG_NAMES should contain save" + name);
            }
            if (name.startsWith(SampleSaveConfiguration.CONFIG_SETTER_PREFIX)
                    && method.getParameterTypes().length == 1
                    && boolean.class.equals(method.getParameterTypes()[0])) {
                name = name.substring(
                        SampleSaveConfiguration.CONFIG_SETTER_PREFIX.length());
                setMethodNames.add(name);
                assertTrue(SampleSaveConfiguration.SAVE_CONFIG_NAMES
                        .contains(name), "SAVE_CONFIG_NAMES should contain set" + name);
            }
        }
        for (String name : SampleSaveConfiguration.SAVE_CONFIG_NAMES) {
            assertTrue(getMethodNames.contains(name), "SAVE_CONFIG_NAMES should NOT contain save" + name);
            assertTrue(setMethodNames.contains(name), "SAVE_CONFIG_NAMES should NOT contain set" + name);
        }
    }