// Path: json-path/src/main/java/com/jayway/jsonpath/JsonPath.java
// public static DocumentContext parse(Object json) {
//     return new ParseContextImpl().parse(json);
// }
// 
// Path: json-path/src/main/java/com/jayway/jsonpath/JsonPath.java
// public static ParseContext using(Configuration configuration) {
//     return new ParseContextImpl(configuration);
// }


import jakarta.json.JsonObject;
import jakarta.json.JsonString;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import static com.jayway.jsonpath.JsonPath.parse;
import static com.jayway.jsonpath.JsonPath.using;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.emptyMap;
import static org.assertj.core.api.Assertions.assertThat;

		using(JAKARTA_JSON_RW_CONFIGURATION)
				.parse(JSON_DOCUMENT)
				.renameKey("$", "fake", "new-fake")
				.json();
	}

	@Test
	public void single_match_value_can_be_mapped() {
		MapFunction mapFunction = new ToStringMapFunction();
		String stringResult = using(JAKARTA_JSON_RW_CONFIGURATION)
				.parse(JSON_DOCUMENT)
				.map("$.string-property", mapFunction)
				.read("$.string-property", String.class);
		assertThat(stringResult.endsWith("converted")).isTrue();
	}

	@Test
	public void object_can_be_mapped() {
		TypeRef<List<String>> typeRef = new TypeRef<List<String>>() {};
		MapFunction mapFunction = new ToStringMapFunction();
		DocumentContext dc = using(JAKARTA_JSON_RW_CONFIGURATION).parse(JSON_DOCUMENT);
		Object list = dc.read("$..book");
		assertThat(list).isInstanceOf(List.class);
		Object res = dc.map("$..book", mapFunction).read("$..book", typeRef).get(0);
		assertThat(res).isInstanceOf(String.class);
		assertThat((String) res).endsWith("converted");
	}

	@Test
	public void multi_match_path_can_be_mapped() {

// Path: json-path/src/main/java/com/jayway/jsonpath/JsonPath.java
// public static DocumentContext parse(Object json) {
//     return new ParseContextImpl().parse(json);
// }
// 
// Path: json-path/src/main/java/com/jayway/jsonpath/JsonPath.java
// public static ParseContext using(Configuration configuration) {
//     return new ParseContextImpl(configuration);
// }


// Path: json-path/src/test/java/com/jayway/jsonpath/JakartaJsonProviderTest.java
import jakarta.json.JsonObject;
import jakarta.json.JsonString;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import static com.jayway.jsonpath.JsonPath.parse;
import static com.jayway.jsonpath.JsonPath.using;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.emptyMap;
import static org.assertj.core.api.Assertions.assertThat;

		using(JAKARTA_JSON_RW_CONFIGURATION)
				.parse(JSON_DOCUMENT)
				.renameKey("$", "fake", "new-fake")
				.json();
	}

	@Test
	public void single_match_value_can_be_mapped() {
		MapFunction mapFunction = new ToStringMapFunction();
		String stringResult = using(JAKARTA_JSON_RW_CONFIGURATION)
				.parse(JSON_DOCUMENT)
				.map("$.string-property", mapFunction)
				.read("$.string-property", String.class);
		assertThat(stringResult.endsWith("converted")).isTrue();
	}

	@Test
	public void object_can_be_mapped() {
		TypeRef<List<String>> typeRef = new TypeRef<List<String>>() {};
		MapFunction mapFunction = new ToStringMapFunction();
		DocumentContext dc = using(JAKARTA_JSON_RW_CONFIGURATION).parse(JSON_DOCUMENT);
		Object list = dc.read("$..book");
		assertThat(list).isInstanceOf(List.class);
		Object res = dc.map("$..book", mapFunction).read("$..book", typeRef).get(0);
		assertThat(res).isInstanceOf(String.class);
		assertThat((String) res).endsWith("converted");
	}

	@Test
	public void multi_match_path_can_be_mapped() {

		MapFunction mapFunction = new ToStringMapFunction();
