@Test
public void shouldSerializeParameterEntriesWithHeader() throws Exception {

    // given
    Level[] levels = new Level[]{
        level().withName("one").build(),
        level().withName("two").build()
    };
    Parameter parameter = parameter().withLevels(levels).build();
    ParameterEntry[] entries = new ParameterEntry[]{
        parameterEntry().withLevels("entry_one", "entry_one").build(),
        parameterEntry().withLevels("entry_two", "entry_two").build()
    };
    when(entryBatchLoader.hasMore()).thenAnswer(new EntryBatchLoaderHasMoreAnswer());
    when(entryBatchLoader.nextBatch(anyInt())).thenReturn(Arrays.asList(entries));
    StringWriter writer = new StringWriter();
    // when
    serializer.serialize(config, writer, parameter, entryBatchLoader);
    // then
    assertThat(writer.toString()).containsOnlyOnce("one;two")
            .containsOnlyOnce("entry_one;entry_one").containsOnlyOnce("entry_two;entry_two");
}