package org.reactfx;

import static org.junit.Assert.*;

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


public class PrependEventStreamTest {

    @Test
    public void test() {
        EventCounter countsTwice = new EventCounter();
        EventCounter countsOnce = new EventCounter();

        EventSource<Boolean> source = new EventSource<>();
        EventStream<Boolean> stream = source.prepend(true);

        stream.subscribe(countsTwice::accept);
        source.push(false);
        stream.subscribe(countsOnce::accept);

        assertEquals("Counts Twice failed", 2, countsTwice.get());
        assertEquals("Counts Once failed", 1, countsOnce.get());
    }
}

@@ -61,47 +61,129 @@
 ort 
-org.junit.Before;%0Aimport org.junit.Test
+java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.junit.Test;%0Aimport org.reactfx.value.Var
 ;%0A%0A%0A
@@ -745,11 +745,331 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testAutoEmittingStream() %7B%0A        List%3CInteger%3E emitted = new ArrayList%3C%3E();%0A        Var%3CInteger%3E source = Var.newSimpleVar(1);%0A        EventStream%3CInteger%3E stream = source.values().prepend(0);%0A        stream.subscribe(emitted::add);%0A        assertEquals(Arrays.asList(0, 1), emitted);%0A    %7D
 %0A%7D%0A

Add failing test for prepend.