// Path: src/test/java/de/fesere/hypermedia/cj/example/employeeDB/transformations/DepratmentTransformer.java
// public class DepratmentTransformer implements ReadTransformation<Department> {
//     @Override
//     public Department transform(Item item) {
//         return new Department(item.getString("dept_no"), item.getString("dept_name"), item.getHref());
//     }
// }
// 
// Path: src/test/java/de/fesere/hypermedia/cj/example/employeeDB/transformations/EmployeeTransformer.java
// public class EmployeeTransformer extends TwoWayTransformer<Employee> {
// 
//     @Override
//     public Employee transform(Item item) {
// 
//         return new Employee(item.getInt("emp_no"),
//                 item.getString("birth_date"),
//                 item.getString("first_name"),
//                 item.getString("last_name"),
//                 item.getString("gender"));
//     }
// 
//     @Override
//     public Item transform(Employee input) {
//         Item item = new Item();
//         item.addData(create("birth_date", input.getBirthday()));
//         item.addData(create("first_name", input.getFirstName()));
//         item.addData(create("last_name", input.getLastName()));
//         item.addData(create("gender", input.getGender()));
// 
//         return item;
//     }
// }


import de.fesere.hypermedia.cj.example.employeeDB.transformations.DepratmentTransformer;
import de.fesere.hypermedia.cj.example.employeeDB.transformations.EmployeeTransformer;
import de.fesere.hypermedia.cj.model.*;
import java.net.URI;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
        return httpCjClient.follow(filledQuery).transform(new EmployeeTransformer());
    }

    private class CollectionIterator implements Iterator<Collection> {

        private Collection context;
        private final CjClient cjClient;

        public CollectionIterator(Collection context, CjClient cjClient) {
            this.context = context;
            this.cjClient = cjClient;
        }

        @Override
        public boolean hasNext() {
            return context != null && context.getLink("next") != null;
        }

        @Override
        public Collection next() {

            URI nextUri = context.getLink("next").getHref();

            Collection next = cjClient.readCollection(nextUri);
            context = next;

            return next;
        }

        @Override
// Path: src/test/java/de/fesere/hypermedia/cj/example/employeeDB/transformations/DepratmentTransformer.java
// public class DepratmentTransformer implements ReadTransformation<Department> {
//     @Override
//     public Department transform(Item item) {
//         return new Department(item.getString("dept_no"), item.getString("dept_name"), item.getHref());
//     }
// }
// 
// Path: src/test/java/de/fesere/hypermedia/cj/example/employeeDB/transformations/EmployeeTransformer.java
// public class EmployeeTransformer extends TwoWayTransformer<Employee> {
// 
//     @Override
//     public Employee transform(Item item) {
// 
//         return new Employee(item.getInt("emp_no"),
//                 item.getString("birth_date"),
//                 item.getString("first_name"),
//                 item.getString("last_name"),
//                 item.getString("gender"));
//     }
// 
//     @Override
//     public Item transform(Employee input) {
//         Item item = new Item();
//         item.addData(create("birth_date", input.getBirthday()));
//         item.addData(create("first_name", input.getFirstName()));
//         item.addData(create("last_name", input.getLastName()));
//         item.addData(create("gender", input.getGender()));
// 
//         return item;
//     }
// }


// Path: src/test/java/de/fesere/hypermedia/cj/example/employeeDB/EmployeeDB.java
import de.fesere.hypermedia.cj.example.employeeDB.transformations.DepratmentTransformer;
import de.fesere.hypermedia.cj.example.employeeDB.transformations.EmployeeTransformer;
import de.fesere.hypermedia.cj.model.*;
import java.net.URI;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

        return httpCjClient.follow(filledQuery).transform(new EmployeeTransformer());
    }

    private class CollectionIterator implements Iterator<Collection> {

        private Collection context;
        private final CjClient cjClient;

        public CollectionIterator(Collection context, CjClient cjClient) {
            this.context = context;
            this.cjClient = cjClient;
        }

        @Override
        public boolean hasNext() {
            return context != null && context.getLink("next") != null;
        }

        @Override
        public Collection next() {

            URI nextUri = context.getLink("next").getHref();

            Collection next = cjClient.readCollection(nextUri);
            context = next;

            return next;
        }

        @Override
        public void remove() {