// Path: src/main/java/io/github/sskorol/utils/ReflectionUtils.java
// @SuppressWarnings("unchecked")
// public static <T> Class<T[]> castToArray(final Class<T> entityClass) {
//     return (Class<T[]>) (entityClass.isArray() ? entityClass : Array.newInstance(entityClass, 1).getClass());
// }
// 
// Path: src/main/java/io/github/sskorol/utils/ReflectionUtils.java
// @SuppressWarnings("unchecked")
// public static <T> Class<T> castToObject(final Class<T> entityClass) {
//     return (Class<T>) (entityClass.isArray() ? entityClass.getComponentType() : entityClass);
// }


import com.google.gson.Gson;
import com.google.gson.JsonElement;
import lombok.AllArgsConstructor;
import lombok.Getter;
import one.util.streamex.StreamEx;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import static com.google.gson.JsonParser.parseReader;
import static io.github.sskorol.utils.ReflectionUtils.castToArray;
import static io.github.sskorol.utils.ReflectionUtils.castToObject;
import static io.vavr.API.*;
import static java.lang.String.format;
package io.github.sskorol.data;




@AllArgsConstructor
public class JsonReader<T> implements DataReader<T> {

    @Getter
    private final Class<T> entityClass;
    @Getter
// Path: src/main/java/io/github/sskorol/utils/ReflectionUtils.java
// @SuppressWarnings("unchecked")
// public static <T> Class<T[]> castToArray(final Class<T> entityClass) {
//     return (Class<T[]>) (entityClass.isArray() ? entityClass : Array.newInstance(entityClass, 1).getClass());
// }
// 
// Path: src/main/java/io/github/sskorol/utils/ReflectionUtils.java
// @SuppressWarnings("unchecked")
// public static <T> Class<T> castToObject(final Class<T> entityClass) {
//     return (Class<T>) (entityClass.isArray() ? entityClass.getComponentType() : entityClass);
// }


// Path: src/main/java/io/github/sskorol/data/JsonReader.java
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import lombok.AllArgsConstructor;
import lombok.Getter;
import one.util.streamex.StreamEx;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import static com.google.gson.JsonParser.parseReader;
import static io.github.sskorol.utils.ReflectionUtils.castToArray;
import static io.github.sskorol.utils.ReflectionUtils.castToObject;
import static io.vavr.API.*;
import static java.lang.String.format;

package io.github.sskorol.data;




@AllArgsConstructor
public class JsonReader<T> implements DataReader<T> {

    @Getter
    private final Class<T> entityClass;
    @Getter
    private final String path;