// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Client.java
// public interface Client {
// 
//     /**
//      * Synchronously execute an HTTP represented by {@code request} and encapsulate all response data
//      * into a {@link Response} instance.
//      */
//     Response execute(Request request) throws IOException;
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Request.java
// public class Request {
// 
//     private final String method;
//     private final String url;
//     private final List<Header> headers;
//     private final TypedOutput body;
// 
//     public Request(String method, String url, List<Header> headers, TypedOutput body) {
//         this.method = method;
//         this.url = url;
//         this.headers = headers;
//         this.body = body;
//     }
// 
//     /** HTTP method verb. */
//     public String getMethod() {
//         return method;
//     }
// 
//     /** Target URL. */
//     public String getUrl() {
//         return url;
//     }
// 
//     /** Returns an unmodifiable list of headers, never {@code null}. */
//     public List<Header> getHeaders() {
//         return headers;
//     }
// 
//     /** Returns the request body or {@code null}. */
//     public TypedOutput getBody() {
//         return body;
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Response.java
// public class Response {
// 
//     private final String url;
//     private final int status;
//     private final String reason;
//     private final List<Header> headers;
//     private final TypedInput body;
// 
//     public Response(String url, int status, String reason, List<Header> headers, TypedInput body) {
//         this.url = url;
//         this.status = status;
//         this.reason = reason;
//         this.headers = headers;
//         this.body = body;
//     }
// 
//     /** Request URL. */
//     public String getUrl() {
//         return url;
//     }
// 
//     /** Status line code. */
//     public int getStatus() {
//         return status;
//     }
// 
//     /** Status line reason phrase. */
//     public String getReason() {
//         return reason;
//     }
// 
//     /** An unmodifiable collection of headers. */
//     public List<Header> getHeaders() {
//         return headers;
//     }
// 
//     /** Response body. May be {@code null}. */
//     public TypedInput getBody() {
//         return body;
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/TypedInput.java
// public interface TypedInput {
// 
//     /** Returns the mime type. */
//     String mimeType();
// 
//     /** Length in bytes. Returns {@code -1} if length is unknown. */
//     long length();
// 
//     /**
//      * Read bytes as stream. Unless otherwise specified, this method may only be called once. It is
//      * the responsibility of the caller to close the stream.
//      */
//     InputStream in() throws IOException;
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/pusher/PusherBuilder.java
// public class PusherBuilder {
// 
//     private static final String API_KEY = "44ffe67af1c7035be764";
// 
//     private PusherOptions options;
// 
//     /** Options for the Pusher client library to use. */
//     public PusherBuilder setOptions(PusherOptions options) {
//         this.options = options;
//         return this;
//     }
// 
//     public PusherBuilder buildUpon() {
//         return new PusherBuilder().setOptions(options);
//     }
// 
//     /**
//      * Create the {@link com.pusher.client.Pusher} instances.
//      */
//     public Pusher build() {
//         if (options == null) {
//             return new Pusher(API_KEY);
//         }
//         return new Pusher(API_KEY, options);
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/transform/Converter.java
// public interface Converter {
// 
//     /**
//      * Convert an HTTP response body to a concrete object of the specified type.
//      * 
//      * @param body HTTP response body.
//      * @param type Target object type.
//      * @return Instance of {@code type} which will be cast by the caller.
//      * @throws Exception
//      */
//     <T> T convert(TypedInput body, Type type) throws ConversionException, IOException;
// }


import com.pusher.client.Pusher;
import com.uphyca.idobata.http.Client;
import com.uphyca.idobata.http.Request;
import com.uphyca.idobata.http.Response;
import com.uphyca.idobata.http.TypedInput;
import com.uphyca.idobata.model.*;
import com.uphyca.idobata.pusher.PusherBuilder;
import com.uphyca.idobata.transform.Converter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.*;
        @Override
        public PusherBuilder buildUpon() {
            return this;
        }

        @Override
        public Pusher build() {
            return pusher;
        }
    };

    @Before
    public void setUp() throws Exception {
        underTest = new IdobataBuilder().setClient(client)
                                        .setRequestInterceptor(requestInterceptor)
                                        .setConverter(converter)
                                        .setPusherBuilder(pusherBuilder)
                                        .build();
    }

    @Test
    public void assertPreconditions() throws Exception {
        assertThat(client).isNotNull();
        assertThat(requestInterceptor).isNotNull();
        assertThat(converter).isNotNull();
        assertThat(underTest).isNotNull();
    }

    @Test
    public void getSeed() throws Exception {
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Client.java
// public interface Client {
// 
//     /**
//      * Synchronously execute an HTTP represented by {@code request} and encapsulate all response data
//      * into a {@link Response} instance.
//      */
//     Response execute(Request request) throws IOException;
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Request.java
// public class Request {
// 
//     private final String method;
//     private final String url;
//     private final List<Header> headers;
//     private final TypedOutput body;
// 
//     public Request(String method, String url, List<Header> headers, TypedOutput body) {
//         this.method = method;
//         this.url = url;
//         this.headers = headers;
//         this.body = body;
//     }
// 
//     /** HTTP method verb. */
//     public String getMethod() {
//         return method;
//     }
// 
//     /** Target URL. */
//     public String getUrl() {
//         return url;
//     }
// 
//     /** Returns an unmodifiable list of headers, never {@code null}. */
//     public List<Header> getHeaders() {
//         return headers;
//     }
// 
//     /** Returns the request body or {@code null}. */
//     public TypedOutput getBody() {
//         return body;
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/Response.java
// public class Response {
// 
//     private final String url;
//     private final int status;
//     private final String reason;
//     private final List<Header> headers;
//     private final TypedInput body;
// 
//     public Response(String url, int status, String reason, List<Header> headers, TypedInput body) {
//         this.url = url;
//         this.status = status;
//         this.reason = reason;
//         this.headers = headers;
//         this.body = body;
//     }
// 
//     /** Request URL. */
//     public String getUrl() {
//         return url;
//     }
// 
//     /** Status line code. */
//     public int getStatus() {
//         return status;
//     }
// 
//     /** Status line reason phrase. */
//     public String getReason() {
//         return reason;
//     }
// 
//     /** An unmodifiable collection of headers. */
//     public List<Header> getHeaders() {
//         return headers;
//     }
// 
//     /** Response body. May be {@code null}. */
//     public TypedInput getBody() {
//         return body;
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/http/TypedInput.java
// public interface TypedInput {
// 
//     /** Returns the mime type. */
//     String mimeType();
// 
//     /** Length in bytes. Returns {@code -1} if length is unknown. */
//     long length();
// 
//     /**
//      * Read bytes as stream. Unless otherwise specified, this method may only be called once. It is
//      * the responsibility of the caller to close the stream.
//      */
//     InputStream in() throws IOException;
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/pusher/PusherBuilder.java
// public class PusherBuilder {
// 
//     private static final String API_KEY = "44ffe67af1c7035be764";
// 
//     private PusherOptions options;
// 
//     /** Options for the Pusher client library to use. */
//     public PusherBuilder setOptions(PusherOptions options) {
//         this.options = options;
//         return this;
//     }
// 
//     public PusherBuilder buildUpon() {
//         return new PusherBuilder().setOptions(options);
//     }
// 
//     /**
//      * Create the {@link com.pusher.client.Pusher} instances.
//      */
//     public Pusher build() {
//         if (options == null) {
//             return new Pusher(API_KEY);
//         }
//         return new Pusher(API_KEY, options);
//     }
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/transform/Converter.java
// public interface Converter {
// 
//     /**
//      * Convert an HTTP response body to a concrete object of the specified type.
//      * 
//      * @param body HTTP response body.
//      * @param type Target object type.
//      * @return Instance of {@code type} which will be cast by the caller.
//      * @throws Exception
//      */
//     <T> T convert(TypedInput body, Type type) throws ConversionException, IOException;
// }


// Path: idobata4j-core/src/test/java/com/uphyca/idobata/IdobataTest.java
import com.pusher.client.Pusher;
import com.uphyca.idobata.http.Client;
import com.uphyca.idobata.http.Request;
import com.uphyca.idobata.http.Response;
import com.uphyca.idobata.http.TypedInput;
import com.uphyca.idobata.model.*;
import com.uphyca.idobata.pusher.PusherBuilder;
import com.uphyca.idobata.transform.Converter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.*;

        @Override
        public PusherBuilder buildUpon() {
            return this;
        }

        @Override
        public Pusher build() {
            return pusher;
        }
    };

    @Before
    public void setUp() throws Exception {
        underTest = new IdobataBuilder().setClient(client)
                                        .setRequestInterceptor(requestInterceptor)
                                        .setConverter(converter)
                                        .setPusherBuilder(pusherBuilder)
                                        .build();
    }

    @Test
    public void assertPreconditions() throws Exception {
        assertThat(client).isNotNull();
        assertThat(requestInterceptor).isNotNull();
        assertThat(converter).isNotNull();
        assertThat(underTest).isNotNull();
    }

    @Test
    public void getSeed() throws Exception {
        Response response = mock(Response.class);