src/main/java/io/magicthegathering/javasdk/api/MTGAPI.java
protected static <TYPE> List<TYPE> getList(String path, String key,
			Class<TYPE> expectedClass) {
		Gson deserializer = new GsonBuilder().create();
		List<TYPE> toReturn = new ArrayList<>();
		List<JsonObject> jsonObjectList = getJsonObject(path, deserializer);

		for(JsonObject jsonObject : jsonObjectList) {
			for (JsonElement jsonElement :
					jsonObject.get(key).getAsJsonArray()) {
				toReturn.add(deserializer.fromJson(
						jsonElement, expectedClass));
			}
		}

		return toReturn;
	}
protected static <TYPE> List<TYPE> getList(String path, String key,
			Class<TYPE> expectedClass) {
		Gson deserializer = new GsonBuilder().create();
		List<TYPE> toReturn = new ArrayList<>();
		List<JsonObject> jsonObjectList = getJsonObject(path, deserializer);

		for(JsonObject jsonObject : jsonObjectList) {
			for (JsonElement jsonElement :
					jsonObject.get(key).getAsJsonArray()) {
				toReturn.add(deserializer.fromJson(
						jsonElement, expectedClass));
			}
		}

		return toReturn;
	}
protected static < TYPE > List < TYPE > getList ( String path , String key , Class < TYPE > expectedClass ) { Gson deserializer = new GsonBuilder ( ) . create ( ) ; List < TYPE > toReturn = new ArrayList <> ( ) ; List < JsonObject > jsonObjectList = getJsonObject ( path , deserializer ) ; for ( JsonObject jsonObject : jsonObjectList ) { for ( JsonElement jsonElement : jsonObject . get ( key ) . getAsJsonArray ( ) ) { toReturn . add ( deserializer . fromJson ( jsonElement , expectedClass ) ) ; } } return toReturn ; }
Make an HTTP GET request to the given path and map the array under the
given key in the JSON of the response to a {@link List} of type
{@link TYPE}.

@param path Controlled by what is calling the function, currently "sets" or "cards"
depending on the calling class.
@param key The key for the JSON element we are looking for.
@param expectedClass The class type we are expecting to get back.
@return a {@link List} of {@link TYPE}
Make an HTTP GET request to the given path and map the array under the given key in the JSON of the response to a { @link List } of type { @link TYPE } .