/*
 * Copyright (C) 2015 8tory, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package rx.bolts;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import bolts.Task;

//import static org.mockito.Matchers.any;
//import static org.mockito.Mockito.mock;
//import static org.mockito.Mockito.times;
//import static org.mockito.Mockito.verify;
//import static org.mockito.Mockito.when;
//import static org.mockito.Mockito.doReturn;
//import static mocker.Mocker.mocker;
//import mocker.Mocker;
import static rx.assertions.RxAssertions.assertThat;

import rx.Observable;

public class TaskObservableTests {

    @Test
    public void just() {
        assertThat(TaskObservable.<String>just(Task.<String>forResult(null)))
            .withoutErrors()
            .emitsNothing()
            .completes();

        assertThat(TaskObservable.<String>just(Task.<String>forResult("hello")))
            .withoutErrors()
            .expectedValues("hello")
            .completes();
    }

    @Test
    public void justNullable() {
        assertThat(TaskObservable.<String>justNullable(Task.<String>forResult(null)))
            .withoutErrors()
            .expectedValues((String) null)
            .completes();
    }

    @Test
    public void defer() {
        assertThat(TaskObservable.<String>defer(() -> Task.<String>forResult(null)))
            .withoutErrors()
            .emitsNothing()
            .completes();

        assertThat(TaskObservable.<String>defer(() -> Task.<String>forResult("hello")))
            .withoutErrors()
            .expectedValues("hello")
            .completes();
    }

    @Test
    public void deferNullable() {
        assertThat(TaskObservable.<String>deferNullable(() -> Task.<String>forResult(null)))
            .withoutErrors()
            .expectedValues((String) null)
            .completes();
    }

    @Test
    public void deferNonNull() {
        assertThat(TaskObservable.<String>deferNonNull(() -> Task.<String>forResult(null)))
            .failsWithThrowable(NullPointerException.class);
    }


}

@@ -1283,32 +1283,24 @@
 kObservable.
-%3CString%3E
 just(Task.%3CS
@@ -1437,32 +1437,24 @@
 kObservable.
-%3CString%3E
 just(Task.%3CS
@@ -1447,32 +1447,24 @@
 e.just(Task.
-%3CString%3E
 forResult(%22h
@@ -1648,24 +1648,16 @@
 ervable.
-%3CString%3E
 justNull
@@ -1863,32 +1863,24 @@
 kObservable.
-%3CString%3E
 defer(() -%3E 
@@ -2024,32 +2024,24 @@
 kObservable.
-%3CString%3E
 defer(() -%3E 
@@ -2041,32 +2041,24 @@
 (() -%3E Task.
-%3CString%3E
 forResult(%22h
@@ -2239,32 +2239,24 @@
 kObservable.
-%3CString%3E
 deferNullabl
@@ -2476,24 +2476,16 @@
 ervable.
-%3CString%3E
 deferNon

Remove unused generic type