// Path: graphql-testdata/src/main/java/org/example/graphql/testdata/utils/MapBuilder.java
// public static <K, V> Map.Entry<K, V> entry(K key, V value) {
//     return new AbstractMap.SimpleEntry<>(key, value);
// }
// 
// Path: graphql-testdata/src/main/java/org/example/graphql/testdata/utils/MapBuilder.java
// @SafeVarargs
// public static <K, V> Map<K, V> immutableMapOf(Map.Entry<K, V> ...entries) {
//     return Collections.unmodifiableMap(mapOf(entries));
// }


import graphql.schema.DataFetcher;
import graphql.schema.TypeResolver;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static org.example.graphql.testdata.utils.MapBuilder.entry;
import static org.example.graphql.testdata.utils.MapBuilder.immutableMapOf;
            String id = environment.getArgument("id");
            return humanData.get(id);
        };
    }

    @SuppressWarnings({"unchecked", "SuspiciousMethodCalls"})
    static TypeResolver getCharacterTypeResolver() {
        return object -> {
            Object id = ((Map<String, Object>) object).get("id");
            if (humanData.containsKey(id)) {
                return StarWarsSchema.humanType;
            }
            return null;
        };
    }

    @SuppressWarnings("unchecked")
    static DataFetcher getFriendsDataFetcher() {
        return environment -> {
            List<Object> result = Collections.emptyList();
            List<String> friends = (List<String>) ((Map<String, Object>) environment.getSource()).get("friends");
            result.addAll(friends.stream().map(HumanData::getCharacter).collect(Collectors.toList()));
            return result;
        };
    }

    @SuppressWarnings("unused")
    static DataFetcher getHeroDataFetcher() {
        return environment -> {
            if (environment.containsArgument("episode")
// Path: graphql-testdata/src/main/java/org/example/graphql/testdata/utils/MapBuilder.java
// public static <K, V> Map.Entry<K, V> entry(K key, V value) {
//     return new AbstractMap.SimpleEntry<>(key, value);
// }
// 
// Path: graphql-testdata/src/main/java/org/example/graphql/testdata/utils/MapBuilder.java
// @SafeVarargs
// public static <K, V> Map<K, V> immutableMapOf(Map.Entry<K, V> ...entries) {
//     return Collections.unmodifiableMap(mapOf(entries));
// }


// Path: graphql-testdata/src/main/java/org/example/graphql/testdata/starwars/HumanData.java
import graphql.schema.DataFetcher;
import graphql.schema.TypeResolver;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static org.example.graphql.testdata.utils.MapBuilder.entry;
import static org.example.graphql.testdata.utils.MapBuilder.immutableMapOf;

            String id = environment.getArgument("id");
            return humanData.get(id);
        };
    }

    @SuppressWarnings({"unchecked", "SuspiciousMethodCalls"})
    static TypeResolver getCharacterTypeResolver() {
        return object -> {
            Object id = ((Map<String, Object>) object).get("id");
            if (humanData.containsKey(id)) {
                return StarWarsSchema.humanType;
            }
            return null;
        };
    }

    @SuppressWarnings("unchecked")
    static DataFetcher getFriendsDataFetcher() {
        return environment -> {
            List<Object> result = Collections.emptyList();
            List<String> friends = (List<String>) ((Map<String, Object>) environment.getSource()).get("friends");
            result.addAll(friends.stream().map(HumanData::getCharacter).collect(Collectors.toList()));
            return result;
        };
    }

    @SuppressWarnings("unused")
    static DataFetcher getHeroDataFetcher() {
        return environment -> {
            if (environment.containsArgument("episode")
                    && 5 == (int) environment.getArgument("episode")) return luke;