@Override
    public Map<String, Object> getPersistedFields() {
        return ImmutableMap.<String, Object>builder()
                .put(FIELD_ID, id)
                .put(FIELD_TITLE, title)
                .put(FIELD_ORDER, order)
                .put(FIELD_TYPE, superType.toString().toLowerCase(Locale.ENGLISH))
                .put(FIELD_CURSOR_STRATEGY, cursorStrategy.toString().toLowerCase(Locale.ENGLISH))
                .put(FIELD_TARGET_FIELD, targetField)
                .put(FIELD_SOURCE_FIELD, sourceField)
                .put(FIELD_CREATOR_USER_ID, creatorUserId)
                .put(FIELD_EXTRACTOR_CONFIG, extractorConfig)
                .put(FIELD_CONDITION_TYPE, conditionType.toString().toLowerCase(Locale.ENGLISH))
                .put(FIELD_CONDITION_VALUE, conditionValue)
                .put(FIELD_CONVERTERS, converterConfigMap())
                .build();
    }
@Test
    public void testGetPersistedFields() throws Exception {
        final TestExtractor extractor = new TestExtractor.Builder()
                .conditionType(REGEX)
                .conditionValue("^hello")
                .build();

        final Map<String, Object> persistedFields = ImmutableMap.<String, Object>builder()
                .put("id", "test-id")
                .put("title", "test-title")
                .put("order", 0L)
                .put("type", "regex")
                .put("cursor_strategy", "copy")
                .put("target_field", "target")
                .put("source_field", "message")
                .put("creator_user_id", "user")
                .put("extractor_config", Collections.<String, Object>emptyMap())
                .put("condition_type", "regex")
                .put("condition_value", "^hello")
                .put("converters", Collections.<Converter>emptyList())
                .build();

        assertThat(extractor.getPersistedFields()).isEqualTo(persistedFields);
    }