// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/IncludedFieldsParams.java
// public class IncludedFieldsParams {
//     private Set<String> params;
// 
//     public IncludedFieldsParams(Set<String> params) {
//         this.params = params;
//     }
// 
//     public Set<String> getParams() {
//         return params;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         IncludedFieldsParams that = (IncludedFieldsParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "IncludedFieldsParams{" +
//             "params=" + params +
//             '}';
//     }
// }
// 
// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/IncludedRelationsParams.java
// public class IncludedRelationsParams {
//     private Set<Inclusion> params;
// 
//     public IncludedRelationsParams(Set<Inclusion> params) {
//         this.params = params;
//     }
// 
//     public Set<Inclusion> getParams() {
//         return params;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         IncludedRelationsParams that = (IncludedRelationsParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "IncludedRelationsParams{" +
//             "params=" + params +
//             '}';
//     }
// }
// 
// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/SortingParams.java
// public class SortingParams {
//     private Map<String, RestrictedSortingValues> params = new HashMap<>();
// 
//     public SortingParams(Map<String, RestrictedSortingValues> params) {
//         this.params = params;
//     }
// 
//     public Map<String, RestrictedSortingValues> getParams() {
//         return params;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         SortingParams that = (SortingParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public String toString() {
//         return "SortingParams{" +
//             "params=" + params +
//             '}';
//     }
// }


import java.util.*;
import org.junit.Assert;
import org.junit.Test;
import io.katharsis.legacy.queryParams.include.Inclusion;
import io.katharsis.legacy.queryParams.params.IncludedFieldsParams;
import io.katharsis.legacy.queryParams.params.IncludedRelationsParams;
import io.katharsis.legacy.queryParams.params.SortingParams;
import io.katharsis.queryspec.*;
import io.katharsis.resource.mock.models.Project;
import io.katharsis.resource.mock.models.Task;
        QuerySpec inputSpec = new QuerySpec(Task.class);
        inputSpec.includeRelation(Collections.singletonList("project"));

        transitivityCheckTask(inputSpec, expectedParams);

        QueryParams actualParams = converter.fromParams(Task.class, inputSpec);
        Map<String, IncludedRelationsParams> includedRelations = actualParams.getIncludedRelations().getParams();

        Assert.assertEquals(1, includedRelations.size());
        Assert.assertTrue(includedRelations.containsKey("tasks"));
        Assert.assertEquals(1, includedRelations.get("tasks").getParams().size());
        Assert.assertTrue(includedRelations.get("tasks").getParams().contains(new Inclusion("project")));
        Assert.assertEquals("expected params must be the same as the result", expectedParams, actualParams);

        transitivityCheckTask(inputSpec, actualParams);
    }

    @Test
    public void testIncludeRelationsMultipleSame() throws InstantiationException, IllegalAccessException {
        Map<String, Set<String>> params = new HashMap<>();
        addParams(params, "include[tasks]", "project", "projects");
        QueryParams expectedParams = defaultQueryParamsWithOffset0(params);

        QuerySpec inputSpec = new QuerySpec(Task.class);
        inputSpec.includeRelation(Collections.singletonList("projects"));
        inputSpec.includeRelation(Collections.singletonList("project"));

        transitivityCheckTask(inputSpec, expectedParams);

        QueryParams actualParams = converter.fromParams(Task.class, inputSpec);
// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/IncludedFieldsParams.java
// public class IncludedFieldsParams {
//     private Set<String> params;
// 
//     public IncludedFieldsParams(Set<String> params) {
//         this.params = params;
//     }
// 
//     public Set<String> getParams() {
//         return params;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         IncludedFieldsParams that = (IncludedFieldsParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "IncludedFieldsParams{" +
//             "params=" + params +
//             '}';
//     }
// }
// 
// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/IncludedRelationsParams.java
// public class IncludedRelationsParams {
//     private Set<Inclusion> params;
// 
//     public IncludedRelationsParams(Set<Inclusion> params) {
//         this.params = params;
//     }
// 
//     public Set<Inclusion> getParams() {
//         return params;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         IncludedRelationsParams that = (IncludedRelationsParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "IncludedRelationsParams{" +
//             "params=" + params +
//             '}';
//     }
// }
// 
// Path: katharsis-core/src/main/java/io/katharsis/legacy/queryParams/params/SortingParams.java
// public class SortingParams {
//     private Map<String, RestrictedSortingValues> params = new HashMap<>();
// 
//     public SortingParams(Map<String, RestrictedSortingValues> params) {
//         this.params = params;
//     }
// 
//     public Map<String, RestrictedSortingValues> getParams() {
//         return params;
//     }
// 
//     @Override
//     public int hashCode() {
//         return params != null ? params.hashCode() : 0;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         SortingParams that = (SortingParams) o;
// 
//         return params != null ? params.equals(that.params) : that.params == null;
//     }
// 
//     @Override
//     public String toString() {
//         return "SortingParams{" +
//             "params=" + params +
//             '}';
//     }
// }


// Path: katharsis-core/src/test/java/io/katharsis/legacy/queryParams/DefaultQueryParamsConverterTest.java
import java.util.*;
import org.junit.Assert;
import org.junit.Test;
import io.katharsis.legacy.queryParams.include.Inclusion;
import io.katharsis.legacy.queryParams.params.IncludedFieldsParams;
import io.katharsis.legacy.queryParams.params.IncludedRelationsParams;
import io.katharsis.legacy.queryParams.params.SortingParams;
import io.katharsis.queryspec.*;
import io.katharsis.resource.mock.models.Project;
import io.katharsis.resource.mock.models.Task;

        QuerySpec inputSpec = new QuerySpec(Task.class);
        inputSpec.includeRelation(Collections.singletonList("project"));

        transitivityCheckTask(inputSpec, expectedParams);

        QueryParams actualParams = converter.fromParams(Task.class, inputSpec);
        Map<String, IncludedRelationsParams> includedRelations = actualParams.getIncludedRelations().getParams();

        Assert.assertEquals(1, includedRelations.size());
        Assert.assertTrue(includedRelations.containsKey("tasks"));
        Assert.assertEquals(1, includedRelations.get("tasks").getParams().size());
        Assert.assertTrue(includedRelations.get("tasks").getParams().contains(new Inclusion("project")));
        Assert.assertEquals("expected params must be the same as the result", expectedParams, actualParams);

        transitivityCheckTask(inputSpec, actualParams);
    }

    @Test
    public void testIncludeRelationsMultipleSame() throws InstantiationException, IllegalAccessException {
        Map<String, Set<String>> params = new HashMap<>();
        addParams(params, "include[tasks]", "project", "projects");
        QueryParams expectedParams = defaultQueryParamsWithOffset0(params);

        QuerySpec inputSpec = new QuerySpec(Task.class);
        inputSpec.includeRelation(Collections.singletonList("projects"));
        inputSpec.includeRelation(Collections.singletonList("project"));

        transitivityCheckTask(inputSpec, expectedParams);

        QueryParams actualParams = converter.fromParams(Task.class, inputSpec);
        Map<String, IncludedRelationsParams> includedRelations = actualParams.getIncludedRelations().getParams();