@Test
public void testListOutputWithPagination() {

	DocumentContext documentContext = mock(DocumentContext.class);
	DDMDataProviderRequest.Builder builder =
		DDMDataProviderRequest.Builder.newBuilder();
	DDMDataProviderRequest ddmDataProviderRequest = builder.withParameter(
		"paginationStart", "0"
	).withParameter(
		"paginationEnd", "3"
	).build();
	String outputParameterId = StringUtil.randomString();
	DDMRESTDataProviderSettings ddmRESTDataProviderSettings =
		_createSettingsWithOutputParameter(
			outputParameterId, "list output", true, "value;key", "list");
	when(
		documentContext.read(".value", List.class)
	).thenReturn(
		new ArrayList() {
			{
				add("Pernambuco");
				add("Paraiba");
				add("Ceara");
				add("Rio Grande do Norte");
			}
		}
	);
	when(
		documentContext.read(".key")
	).thenReturn(
		new ArrayList() {
			{
				add("1");
				add("2");
				add("3");
				add("4");
			}
		}
	);
	DDMDataProviderResponse ddmDataProviderResponse =
		_ddmRESTDataProvider.createDDMDataProviderResponse(
			documentContext, ddmDataProviderRequest,
			ddmRESTDataProviderSettings);
	Optional<List<KeyValuePair>> optional =
		ddmDataProviderResponse.getOutputOptional(
			outputParameterId, List.class);
	List<KeyValuePair> keyValuePairs = new ArrayList<KeyValuePair>() {
		{
			add(new KeyValuePair("1", "Pernambuco"));
			add(new KeyValuePair("2", "Paraiba"));
			add(new KeyValuePair("3", "Ceara"));
		}
	};
	Assert.assertEquals(
		keyValuePairs.toString(), keyValuePairs, optional.get());
}