// Path: src/main/java/com/github/jasminb/jsonapi/models/errors/Errors.java
// public class Errors {
// 	private List<Error> errors;
// 
// 	public List<Error> getErrors() {
// 		return errors;
// 	}
// 
// 	public void setErrors(List<Error> errors) {
// 		this.errors = errors;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Errors{" +
// 				"errors=" + (errors != null ? errors : "Undefined") +
// 				'}';
// 	}
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.jasminb.jsonapi.models.errors.Errors;
import java.io.IOException;
import java.io.InputStream;
import okhttp3.ResponseBody;
package com.github.jasminb.jsonapi;




/**
 * Utility class providing methods needed for parsing JSON API Spec errors.
 *
 * @author jbegic
 */
public class ErrorUtils {

    private ErrorUtils() {
        // Private constructor
    }

    /**
     * Parses provided ResponseBody and returns it as T.
     *
     * @param mapper        Jackson Object mapper instance
     * @param errorResponse error response body
     * @return T collection
     * @throws IOException
     */
// Path: src/main/java/com/github/jasminb/jsonapi/models/errors/Errors.java
// public class Errors {
// 	private List<Error> errors;
// 
// 	public List<Error> getErrors() {
// 		return errors;
// 	}
// 
// 	public void setErrors(List<Error> errors) {
// 		this.errors = errors;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Errors{" +
// 				"errors=" + (errors != null ? errors : "Undefined") +
// 				'}';
// 	}
// }


// Path: src/main/java/com/github/jasminb/jsonapi/ErrorUtils.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.jasminb.jsonapi.models.errors.Errors;
import java.io.IOException;
import java.io.InputStream;
import okhttp3.ResponseBody;

package com.github.jasminb.jsonapi;




/**
 * Utility class providing methods needed for parsing JSON API Spec errors.
 *
 * @author jbegic
 */
public class ErrorUtils {

    private ErrorUtils() {
        // Private constructor
    }

    /**
     * Parses provided ResponseBody and returns it as T.
     *
     * @param mapper        Jackson Object mapper instance
     * @param errorResponse error response body
     * @return T collection
     * @throws IOException
     */
    public static <T extends Errors> T parseErrorResponse(ObjectMapper mapper, ResponseBody errorResponse, Class<T> cls) throws IOException {