diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bfa6a22
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+# Created by .ignore support plugin (hsz.mobi)
diff --git a/.idea/Intro-To-RxJava.iml b/.idea/Intro-To-RxJava.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/Intro-To-RxJava.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..515f050
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
new file mode 100644
index 0000000..1c24f9a
--- /dev/null
+++ b/.idea/kotlinc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_unknown.xml b/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_unknown.xml
new file mode 100644
index 0000000..7c6c45c
--- /dev/null
+++ b/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_unknown.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml
new file mode 100644
index 0000000..d411041
--- /dev/null
+++ b/.idea/libraries/Maven__junit_junit_4_12.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_codehaus_groovy_groovy_all_2_4_4.xml b/.idea/libraries/Maven__org_codehaus_groovy_groovy_all_2_4_4.xml
new file mode 100644
index 0000000..d70f739
--- /dev/null
+++ b/.idea/libraries/Maven__org_codehaus_groovy_groovy_all_2_4_4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..f58bbc1
--- /dev/null
+++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_spockframework_spock_core_1_1_groovy_2_4.xml b/.idea/libraries/Maven__org_spockframework_spock_core_1_1_groovy_2_4.xml
new file mode 100644
index 0000000..71f722b
--- /dev/null
+++ b/.idea/libraries/Maven__org_spockframework_spock_core_1_1_groovy_2_4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..481671d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..8168f9f
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..0b21292
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,876 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1505222212074
+
+
+ 1505222212074
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No facets are configured
+
+
+
+
+
+
+
+
+
+
+
+ groovy-2.4.7
+
+
+
+
+
+
+
+
+
+
+
+ 1.7
+
+
+
+
+
+
+
+
+
+
+
+ exercises
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ Maven: io.reactivex.rxjava2:rxjava:unknown
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index eadd1b8..6174307 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
+# Intro to RxJava exercises and code kata
+
+This is my fork for the 'Intro to RxJava repo, which can be found under this link: [[CLICK]](/https://github.com/Froussios/Intro-To-RxJava)'
+
+It will be a place where I will try various stuff from the tutorial.
+
+
+
# Intro to RxJava
This guide aims to introduce a beginner reactive programmer to the complete power of the [RxJava](https://github.com/ReactiveX/RxJava) implementation of reactive programming for the JVM. It is based on the [IntroToRx](http://www.introtorx.com) guide for Rx.NET.
diff --git a/exercises/exercises.iml b/exercises/exercises.iml
new file mode 100644
index 0000000..5ae027b
--- /dev/null
+++ b/exercises/exercises.iml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/exercises/pom.xml b/exercises/pom.xml
new file mode 100644
index 0000000..2f68bea
--- /dev/null
+++ b/exercises/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+
+ com.bobzone.rxjavatutorial
+ exercises
+ 1.0-SNAPSHOT
+
+
+
+ io.reactivex
+ rxjava
+ 1.1.6
+
+
+ org.codehaus.groovy
+ groovy-all
+ 2.4.4
+
+
+ org.spockframework
+ spock-core
+ 1.1-groovy-2.4
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/exercises/src/main/java/main/Book.java b/exercises/src/main/java/main/Book.java
new file mode 100644
index 0000000..f6f883a
--- /dev/null
+++ b/exercises/src/main/java/main/Book.java
@@ -0,0 +1,7 @@
+package main;
+
+public class Book {
+
+ public Book() {
+ }
+}
diff --git a/exercises/src/test/java/main/AsyncSubjectTest.groovy b/exercises/src/test/java/main/AsyncSubjectTest.groovy
new file mode 100644
index 0000000..2051888
--- /dev/null
+++ b/exercises/src/test/java/main/AsyncSubjectTest.groovy
@@ -0,0 +1,39 @@
+package main
+
+import rx.subjects.AsyncSubject
+import spock.lang.Specification
+
+
+class AsyncSubjectTest extends Specification {
+
+ // AsyncSubject cached last value. It doesnt emit anything before sequence finishes.
+ // It is to be used to emit a single value and immediately terminate
+ def "Standard AsyncSubject test"() {
+ when:
+ AsyncSubject s = AsyncSubject.create()
+ s.subscribe { v -> println("Emit: " + v) }
+
+ s.onNext(0)
+ s.onNext(1)
+
+ s.onCompleted()
+
+ then:
+ s.hasValue() && s.hasCompleted()
+ }
+
+ def "AsyncSubject has no values because it did not complete"() {
+ when:
+ AsyncSubject s = AsyncSubject.create()
+ s.subscribe { v -> println("Emit: " + v) }
+
+ s.onNext(0)
+ s.onNext(1)
+
+ //s.onCompleted() <- events didnt complete
+
+ then:
+ !s.hasValue() || !s.hasCompleted()
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/BasicObservableTest.groovy b/exercises/src/test/java/main/BasicObservableTest.groovy
new file mode 100644
index 0000000..8fdb0f1
--- /dev/null
+++ b/exercises/src/test/java/main/BasicObservableTest.groovy
@@ -0,0 +1,95 @@
+package main
+
+import rx.Observable
+import rx.Subscription
+import spock.lang.Specification
+
+import java.util.concurrent.TimeUnit
+
+
+class BasicObservableTest extends Specification {
+
+ def "Emit a series of values then terminate"() {
+ when:
+ Observable s = Observable.just("one", "two", "three")
+ s.subscribe(
+ { v -> println "onNext: " + v },
+ { e -> println "onError: " + e },
+ { println "Completed" }
+ )
+ then:
+ s != null
+ }
+
+ def "Observable.empty emits single onCompleted and nothing else"() {
+ when:
+ Observable s = Observable.empty()
+ s.subscribe(
+ { v -> println "onNext: " + v },
+ { e -> println "onError: " + e },
+ { println "Completed" }
+ )
+ then:
+ s != null
+ }
+
+ def "just() caches one value, which might not be preferred solution"() {
+ when:
+ Observable time = Observable.just(System.currentTimeMillis())
+ time.subscribe { v -> println "Emit: " + v }
+ Thread.sleep(1000)
+ time.subscribe { v -> println "Emit: " + v }
+ then:
+ time != null
+ }
+
+ def "using defer() might solve this problem"() {
+ when:
+ Observable defer = Observable.defer { Observable.just(System.currentTimeMillis()) }
+ defer.subscribe { v -> println "Emit: " + v }
+ Thread.sleep(1000)
+ defer.subscribe { v -> println "Emit: " + v }
+
+ then:
+ defer != null
+ }
+
+ def "Supply a Subscriber to create"() {
+ when:
+ Observable values = Observable.create { o ->
+ o.onNext("Hello");
+ o.onCompleted();
+ }
+ values.subscribe(
+ { v -> println "onNext: " + v },
+ { e -> println "onError: " + e },
+ { println "Completed" }
+ )
+ then:
+ values != null
+ }
+
+ def "Emit specified range of integers"() {
+ when:
+ Observable numbers = Observable.range(1, 15)
+ numbers.subscribe { v -> println v }
+
+ then:
+ numbers != null
+ }
+
+ def "timer() usage example"() {
+ when:
+ Observable values = Observable.timer(2, 1, TimeUnit.SECONDS);
+ Subscription subscription = values.subscribe(
+ { v -> System.out.println("Received: " + v) },
+ { e -> System.out.println("Error: " + e) },
+ { System.out.println("Completed") }
+ )
+ System.in.read();
+
+ then:
+ values != null
+ }
+
+}
diff --git a/exercises/src/test/java/main/BehaviorSubjectTest.groovy b/exercises/src/test/java/main/BehaviorSubjectTest.groovy
new file mode 100644
index 0000000..eb9d073
--- /dev/null
+++ b/exercises/src/test/java/main/BehaviorSubjectTest.groovy
@@ -0,0 +1,57 @@
+package main
+
+import rx.subjects.BehaviorSubject
+import spock.lang.Specification
+
+
+class BehaviorSubjectTest extends Specification {
+
+ // BehavioSubject only remembers last value. Similar to REPLAYSubject with buffer of size 1
+ def "Standard BehaviorSubject test"() {
+ when:
+ BehaviorSubject s = BehaviorSubject.create()
+ s.onNext(0)
+ s.onNext(1)
+ s.onNext(2)
+ s.subscribe { v -> println "Late: " + v }
+ s.onNext(3)
+ then:
+ s.getValues().size() == 1
+ }
+
+ def "BehaviorSubject that is empty because events finished before subscription"() {
+ when:
+ BehaviorSubject s = BehaviorSubject.create();
+ s.onNext(0)
+ s.onNext(1)
+ s.onNext(2)
+ s.onCompleted();
+ s.subscribe(
+ { v -> println v },
+ { println "Error" },
+ { println "Completed" }
+ )
+ then:
+ s.getValues().size() == 0
+ }
+
+ def "BehaviorSubject handles first event if it was placed before someone subscribed"() {
+ when:
+ BehaviorSubject s = BehaviorSubject.create(0);
+ s.subscribe({ v -> println v })
+ s.onNext(1)
+ then:
+ s.getValues().size() == 1
+ }
+
+ def "If events are completed BehaviourSubject empties"() {
+ when:
+ BehaviorSubject s = BehaviorSubject.create(0);
+ s.subscribe({ v -> println v })
+ s.onNext(1)
+ s.onCompleted()
+ then:
+ s.getValues().size() == 0
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/BookTest.groovy b/exercises/src/test/java/main/BookTest.groovy
new file mode 100644
index 0000000..24abb05
--- /dev/null
+++ b/exercises/src/test/java/main/BookTest.groovy
@@ -0,0 +1,18 @@
+package main
+
+import spock.lang.Specification
+import spock.lang.Unroll
+
+
+class BookTest extends Specification {
+
+ @Unroll
+ def "this test should work because it does nothing"() {
+ given:
+ def book = null
+ when:
+ book = new Book()
+ then:
+ book != null
+ }
+}
diff --git a/exercises/src/test/java/main/ErrorHandlingTest.groovy b/exercises/src/test/java/main/ErrorHandlingTest.groovy
new file mode 100644
index 0000000..8110d91
--- /dev/null
+++ b/exercises/src/test/java/main/ErrorHandlingTest.groovy
@@ -0,0 +1,39 @@
+package main
+
+import rx.exceptions.OnErrorNotImplementedException
+import rx.subjects.ReplaySubject
+import spock.lang.Specification
+
+
+class ErrorHandlingTest extends Specification {
+
+ def "onError action appeared in the event stream"() {
+ when:
+ ReplaySubject s = ReplaySubject.create()
+ s.subscribe(
+ { v -> println "onNext: " + v },
+ { e -> println "onError: " + e }
+ )
+ s.onNext(0)
+ s.onError(new Exception("Oops"))
+
+ then:
+ s != null
+ }
+
+ def "onError action appeared in the event stream but no onError action was provided to the subscribe"() {
+ when:
+ ReplaySubject s = ReplaySubject.create()
+ s.subscribe(
+ { v -> println "onNext: " + v },
+// { e -> println "onError: " + e }
+ )
+ s.onNext(0)
+ s.onError(new Exception("Oops"))
+
+ then:
+ s != null
+ thrown OnErrorNotImplementedException
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/InspectionTest.groovy b/exercises/src/test/java/main/InspectionTest.groovy
new file mode 100644
index 0000000..c15b50e
--- /dev/null
+++ b/exercises/src/test/java/main/InspectionTest.groovy
@@ -0,0 +1,78 @@
+package main
+
+import rx.Observable
+import rx.Subscription
+import spock.lang.Specification
+
+import java.util.concurrent.TimeUnit
+
+
+class InspectionTest extends Specification {
+
+ def "all() stablishes that every value emitted by an observable meets given criteria - emits single 'false' because all is not met"() {
+ when:
+ Observable obs = Observable.create {
+ o ->
+ o.onNext(0);
+ o.onNext(10);
+ o.onNext(10);
+ o.onNext(2);
+ o.onNext(5);
+ o.onCompleted();
+ }
+
+ Subscription subscription = obs
+ .all { i -> i % 2 == 0 }
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+ then:
+ obs != null
+ }
+
+ def "now emits single 'true' because all is met"() {
+ when:
+ Observable obs = Observable.create {
+ o ->
+ o.onNext(0);
+ o.onNext(10);
+ o.onNext(10);
+ o.onNext(2);
+ o.onCompleted();
+ }
+
+ Subscription subscription = obs
+ .all { i -> i % 2 == 0 }
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+ then:
+ obs != null
+ }
+
+ def "other example that shows how all() fails safely"() {
+ when:
+ Observable values = Observable.interval(150, TimeUnit.MILLISECONDS).take(5);
+
+ Subscription subscription = values
+ .all { i -> i < 3 } // Will fail eventually
+ .subscribe(
+ { v -> System.out.println("All: " + v) },
+ { e -> System.out.println("All: Error: " + e) },
+ { System.out.println("All: Completed") }
+ );
+ Subscription subscription2 = values
+ .subscribe(
+ { v -> System.out.println(v) },
+ { e -> System.out.println("Error: " + e) },
+ { System.out.println("Completed") }
+ );
+ System.in.read()
+ then:
+ values != null
+ }
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/PublishSubjectTest.groovy b/exercises/src/test/java/main/PublishSubjectTest.groovy
new file mode 100644
index 0000000..989b0f3
--- /dev/null
+++ b/exercises/src/test/java/main/PublishSubjectTest.groovy
@@ -0,0 +1,22 @@
+package main
+
+import rx.subjects.PublishSubject
+import spock.lang.Specification
+
+
+class PublishSubjectTest extends Specification {
+
+ def "When value is pushed to PublishSubject it pushes it down to subscribers at the given moment"() {
+ when:
+ PublishSubject s = PublishSubject.create()
+ s.onNext(0)
+ s.subscribe{ v -> println "Event:" + v }
+ s.onNext(1)
+ s.onNext(2)
+
+ then:
+ s != null
+ }
+
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/ReducingSequenceTest.groovy b/exercises/src/test/java/main/ReducingSequenceTest.groovy
new file mode 100644
index 0000000..91e8930
--- /dev/null
+++ b/exercises/src/test/java/main/ReducingSequenceTest.groovy
@@ -0,0 +1,108 @@
+package main
+
+import rx.Observable
+import rx.Subscription
+import spock.lang.Specification
+
+import java.util.concurrent.TimeUnit
+
+
+class ReducingSequenceTest extends Specification {
+
+ def "test of the distinct() transformation"() {
+ when:
+ Observable obs = Observable.create { o ->
+ o.onNext(1)
+ o.onNext(2)
+ o.onNext(2)
+ o.onNext(3)
+ o.onNext(3)
+ o.onNext(1)
+ o.onCompleted()
+ }
+
+ Subscription subscribe = obs
+ .distinct()
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+
+ then:
+ obs != null
+ }
+
+ def "you can supply the distinct key inside the distinct method"() {
+ when:
+ Observable obs = Observable.create { o ->
+ o.onNext("a")
+ o.onNext("a")
+ o.onNext("b")
+ o.onNext("b")
+ o.onNext("bb")
+ o.onNext("aa")
+ o.onCompleted()
+ }
+
+ Subscription subscribe = obs
+ .distinct { event -> event.charAt(0) }
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+
+ then:
+ obs != null
+ }
+
+ def "you can also use the distinctUntilChanged that filters out only consecutive same events"() {
+ when:
+ Observable obs = Observable.create { o ->
+ o.onNext("a")
+ o.onNext("b")
+ o.onNext("b")
+ o.onNext("aa")
+ o.onNext("bb")
+ o.onNext("bb")
+ o.onCompleted()
+ }
+
+ Subscription subscribe = obs
+ .distinctUntilChanged { event -> event.charAt(0) }
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+
+ then:
+ //expecting a, b, aa, bb
+ obs != null
+ }
+
+ def "takeWhile tests"() {
+ when:
+ Observable obs = Observable
+ .create { o ->
+ o.onNext(1);
+ o.onNext(1);
+ o.onNext(2);
+ o.onNext(3);
+ o.onNext(2);
+ o.onCompleted();
+ }
+
+ Subscription subscription = obs
+ .takeWhile { v -> v < 2 }
+ .subscribe(
+ { v -> println "Emited: " + v },
+ { e -> println "Error: " + e },
+ { println "onCompleted " }
+ )
+
+ then:
+ obs != null
+ }
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/ReplaySubjectTest.groovy b/exercises/src/test/java/main/ReplaySubjectTest.groovy
new file mode 100644
index 0000000..61bbf62
--- /dev/null
+++ b/exercises/src/test/java/main/ReplaySubjectTest.groovy
@@ -0,0 +1,53 @@
+package main
+
+import rx.schedulers.Schedulers
+import rx.subjects.ReplaySubject
+import spock.lang.Specification
+import spock.lang.Unroll
+
+import java.util.concurrent.TimeUnit
+
+
+class ReplaySubjectTest extends Specification {
+
+ @Unroll
+ def "Standard ReplaySubject"() {
+ when:
+ ReplaySubject s = ReplaySubject.create();
+ s.subscribe { v -> println "Early: " + v }
+ s.onNext(0)
+ s.onNext(1)
+ s.subscribe { v -> println "Late: " + v }
+ s.onNext(2)
+ then:
+ s != null
+ }
+
+ def "ReplaySubject with size 2"() {
+ when:
+ ReplaySubject s = ReplaySubject.createWithSize(2)
+ s.onNext(0)
+ s.onNext(1)
+ s.onNext(2)
+ s.onNext(3)
+ s.subscribe { v -> println "Late: " + v }
+ s.onNext(4)
+ then:
+ s != null
+ }
+
+ def "ReplaySubject with createWithTime"() {
+ when:
+ ReplaySubject s = ReplaySubject.createWithTime(550, TimeUnit.MILLISECONDS, Schedulers.immediate())
+ s.onNext(0)
+ Thread.sleep(200)
+ s.onNext(1)
+ Thread.sleep(200)
+ s.onNext(2)
+ s.subscribe { v -> println "Late: " + v }
+ s.onNext(3)
+ then:
+ s != null
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/TransitionToObservableTest.groovy b/exercises/src/test/java/main/TransitionToObservableTest.groovy
new file mode 100644
index 0000000..82e7a91
--- /dev/null
+++ b/exercises/src/test/java/main/TransitionToObservableTest.groovy
@@ -0,0 +1,75 @@
+package main
+
+import rx.Observable
+import rx.Subscription
+import spock.lang.Specification
+
+import java.util.concurrent.FutureTask
+import java.util.concurrent.TimeUnit
+import java.util.concurrent.TimeoutException
+
+
+class TransitionToObservableTest extends Specification {
+
+// Observable events = Observable.create(o -> {
+// button2.setOnAction(new EventHandler() {
+// @Override public void handle(ActionEvent e) {
+// o.onNext(e)
+// }
+// });
+// })
+
+ def "turn future into observable"() {
+ when:
+ FutureTask f = new FutureTask({
+ Thread.sleep(2000);
+ return 21;
+ });
+ new Thread(f).start();
+
+ Observable values = Observable.from(f);
+
+ Subscription subscription = values.subscribe(
+ { v -> System.out.println("Received: " + v) },
+ { e -> System.out.println("Error: " + e) },
+ { System.out.println("Completed") }
+ );
+
+ then:
+ f != null
+ }
+
+ def "turn future into observable, but await only certain time before an event gets emitted"() {
+ when:
+ FutureTask future = new FutureTask({
+ Thread.sleep(3000)
+ return 30
+ })
+
+ Observable obs = Observable.from(future, 2000, TimeUnit.MILLISECONDS)
+
+ Subscription subscription = obs.subscribe(
+ { v -> System.out.println("Received: " + v) },
+ { e -> System.out.println("Error: " + e) },
+ { System.out.println("Completed") }
+ );
+
+ then:
+ thrown TimeoutException
+ }
+
+ def "You can turn any collection into observables as well, elements of the collection will get emitted and then the onComplete event"() {
+ when:
+ Integer[] array = [1, 2, 3, 4]
+ Observable obs = Observable.from(array)
+
+ Subscription subscription = obs.subscribe(
+ { v -> System.out.println("Received: " + v) },
+ { e -> System.out.println("Error: " + e) },
+ { System.out.println("Completed") }
+ );
+ then:// TODO implement then
+ obs != null
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/src/test/java/main/UnsubscribingTest.groovy b/exercises/src/test/java/main/UnsubscribingTest.groovy
new file mode 100644
index 0000000..b9e513e
--- /dev/null
+++ b/exercises/src/test/java/main/UnsubscribingTest.groovy
@@ -0,0 +1,53 @@
+package main
+
+import rx.Subscription
+import rx.functions.Action0
+import rx.subjects.ReplaySubject
+import rx.subjects.Subject
+import rx.subscriptions.Subscriptions
+import spock.lang.Specification
+
+
+class UnsubscribingTest extends Specification {
+
+ def "Unsubscribe will cause stop receiving values"() {
+ when:
+ Subject values = ReplaySubject.create()
+ def subscription = values.subscribe(
+ { v -> println v },
+ { e -> println e },
+ { println "Done" }
+ )
+ values.onNext(0)
+ values.onNext(1)
+ subscription.unsubscribe()
+ values.onNext(2)
+ then:
+ values != null
+ }
+
+ def "Unsubscribing one obs does not interfere with obs on the same observable"() {
+ when:
+ Subject s = ReplaySubject.create()
+ def subscription1 = s.subscribe { v -> println "First:" + v }
+ def subscription2 = s.subscribe { v -> println "Second:" + v }
+
+ s.onNext(0)
+ subscription2.unsubscribe()
+ s.onNext(1)
+
+ then:
+ s != null
+ !subscription1.isUnsubscribed()
+ subscription2.isUnsubscribed()
+ }
+
+ def "Create takes an Action that will be performed upon unsubscription "() {
+ when:
+ Subscription s = Subscriptions.create { println "Clean" }
+ s.unsubscribe()
+ then:
+ s.isUnsubscribed()
+ }
+
+}
\ No newline at end of file
diff --git a/exercises/target/classes/main/Book.class b/exercises/target/classes/main/Book.class
new file mode 100644
index 0000000..916ea7b
Binary files /dev/null and b/exercises/target/classes/main/Book.class differ
diff --git a/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..5def0a3
Binary files /dev/null and b/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_1_closure2.class b/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_1_closure2.class
new file mode 100644
index 0000000..31ec2c5
Binary files /dev/null and b/exercises/target/test-classes/main/AsyncSubjectTest$__spock_feature_0_1_closure2.class differ
diff --git a/exercises/target/test-classes/main/AsyncSubjectTest.class b/exercises/target/test-classes/main/AsyncSubjectTest.class
new file mode 100644
index 0000000..9d52a0b
Binary files /dev/null and b/exercises/target/test-classes/main/AsyncSubjectTest.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..38b5166
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..7dadcba
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure3.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure3.class
new file mode 100644
index 0000000..84c4c03
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_0_closure3.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure4.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure4.class
new file mode 100644
index 0000000..572ce8c
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure4.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure5.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure5.class
new file mode 100644
index 0000000..2eb386f
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure5.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure6.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure6.class
new file mode 100644
index 0000000..b22506d
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_1_closure6.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure7.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure7.class
new file mode 100644
index 0000000..6fc529f
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure7.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure8.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure8.class
new file mode 100644
index 0000000..1b4a50b
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_2_closure8.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure10.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure10.class
new file mode 100644
index 0000000..6cf55bb
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure10.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure11.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure11.class
new file mode 100644
index 0000000..46a9b0c
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure11.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure9.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure9.class
new file mode 100644
index 0000000..3f44b6a
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_3_closure9.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure12.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure12.class
new file mode 100644
index 0000000..773612a
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure12.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure13.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure13.class
new file mode 100644
index 0000000..ef80118
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure13.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure14.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure14.class
new file mode 100644
index 0000000..4ff01cc
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure14.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure15.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure15.class
new file mode 100644
index 0000000..a260844
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_4_closure15.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_5_closure16.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_5_closure16.class
new file mode 100644
index 0000000..d816d96
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_5_closure16.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure17.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure17.class
new file mode 100644
index 0000000..19e64f5
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure17.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure18.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure18.class
new file mode 100644
index 0000000..457d4e5
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure18.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure19.class b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure19.class
new file mode 100644
index 0000000..c08932f
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest$__spock_feature_0_6_closure19.class differ
diff --git a/exercises/target/test-classes/main/BasicObservableTest.class b/exercises/target/test-classes/main/BasicObservableTest.class
new file mode 100644
index 0000000..ff98150
Binary files /dev/null and b/exercises/target/test-classes/main/BasicObservableTest.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..b7e8854
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure2.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure2.class
new file mode 100644
index 0000000..f180d47
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure2.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure3.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure3.class
new file mode 100644
index 0000000..02e4f9a
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure3.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure4.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure4.class
new file mode 100644
index 0000000..2248c37
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_1_closure4.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_2_closure5.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_2_closure5.class
new file mode 100644
index 0000000..dade450
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_2_closure5.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_3_closure6.class b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_3_closure6.class
new file mode 100644
index 0000000..74cfbcd
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest$__spock_feature_0_3_closure6.class differ
diff --git a/exercises/target/test-classes/main/BehaviorSubjectTest.class b/exercises/target/test-classes/main/BehaviorSubjectTest.class
new file mode 100644
index 0000000..f1890bc
Binary files /dev/null and b/exercises/target/test-classes/main/BehaviorSubjectTest.class differ
diff --git a/exercises/target/test-classes/main/BookTest.class b/exercises/target/test-classes/main/BookTest.class
new file mode 100644
index 0000000..b518eea
Binary files /dev/null and b/exercises/target/test-classes/main/BookTest.class differ
diff --git a/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..cd9843b
Binary files /dev/null and b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..618bc6b
Binary files /dev/null and b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_1_closure3.class b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_1_closure3.class
new file mode 100644
index 0000000..1e44858
Binary files /dev/null and b/exercises/target/test-classes/main/ErrorHandlingTest$__spock_feature_0_1_closure3.class differ
diff --git a/exercises/target/test-classes/main/ErrorHandlingTest.class b/exercises/target/test-classes/main/ErrorHandlingTest.class
new file mode 100644
index 0000000..4f61408
Binary files /dev/null and b/exercises/target/test-classes/main/ErrorHandlingTest.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..45ecf78
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..c362b81
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure3.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure3.class
new file mode 100644
index 0000000..5fe8f05
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure3.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure4.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure4.class
new file mode 100644
index 0000000..7842491
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure4.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure5.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure5.class
new file mode 100644
index 0000000..676ad07
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_0_closure5.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure10.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure10.class
new file mode 100644
index 0000000..b4a03e2
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure10.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure6.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure6.class
new file mode 100644
index 0000000..7a7018f
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure6.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure7.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure7.class
new file mode 100644
index 0000000..db3ffbf
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure7.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure8.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure8.class
new file mode 100644
index 0000000..15d6d92
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure8.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure9.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure9.class
new file mode 100644
index 0000000..52a037d
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_1_closure9.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure11.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure11.class
new file mode 100644
index 0000000..39a137e
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure11.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure12.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure12.class
new file mode 100644
index 0000000..ec7987d
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure12.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure13.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure13.class
new file mode 100644
index 0000000..506a774
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure13.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure14.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure14.class
new file mode 100644
index 0000000..939de95
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure14.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure15.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure15.class
new file mode 100644
index 0000000..8faa829
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure15.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure16.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure16.class
new file mode 100644
index 0000000..0a4f781
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure16.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure17.class b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure17.class
new file mode 100644
index 0000000..e4bcf88
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest$__spock_feature_0_2_closure17.class differ
diff --git a/exercises/target/test-classes/main/InspectionTest.class b/exercises/target/test-classes/main/InspectionTest.class
new file mode 100644
index 0000000..428071f
Binary files /dev/null and b/exercises/target/test-classes/main/InspectionTest.class differ
diff --git a/exercises/target/test-classes/main/PublishSubjectTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/PublishSubjectTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..3caa0b0
Binary files /dev/null and b/exercises/target/test-classes/main/PublishSubjectTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/PublishSubjectTest.class b/exercises/target/test-classes/main/PublishSubjectTest.class
new file mode 100644
index 0000000..0c543e8
Binary files /dev/null and b/exercises/target/test-classes/main/PublishSubjectTest.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..508caf2
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..344c0eb
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure3.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure3.class
new file mode 100644
index 0000000..f034e30
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure3.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure4.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure4.class
new file mode 100644
index 0000000..40cc6bc
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_0_closure4.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure5.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure5.class
new file mode 100644
index 0000000..7a1e8c1
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure5.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure6.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure6.class
new file mode 100644
index 0000000..c15792f
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure6.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure7.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure7.class
new file mode 100644
index 0000000..e58fc41
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure7.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure8.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure8.class
new file mode 100644
index 0000000..0788fde
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure8.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure9.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure9.class
new file mode 100644
index 0000000..df94fb3
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_1_closure9.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure10.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure10.class
new file mode 100644
index 0000000..f7bb22a
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure10.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure11.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure11.class
new file mode 100644
index 0000000..81840e9
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure11.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure12.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure12.class
new file mode 100644
index 0000000..5a14181
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure12.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure13.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure13.class
new file mode 100644
index 0000000..03ceddc
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure13.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure14.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure14.class
new file mode 100644
index 0000000..4c402ba
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_2_closure14.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure15.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure15.class
new file mode 100644
index 0000000..eb9b282
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure15.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure16.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure16.class
new file mode 100644
index 0000000..f2791c9
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure16.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure17.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure17.class
new file mode 100644
index 0000000..ef24541
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure17.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure18.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure18.class
new file mode 100644
index 0000000..81dd3e0
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure18.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure19.class b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure19.class
new file mode 100644
index 0000000..5c7b946
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest$__spock_feature_0_3_closure19.class differ
diff --git a/exercises/target/test-classes/main/ReducingSequenceTest.class b/exercises/target/test-classes/main/ReducingSequenceTest.class
new file mode 100644
index 0000000..b03a7e5
Binary files /dev/null and b/exercises/target/test-classes/main/ReducingSequenceTest.class differ
diff --git a/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..02dc575
Binary files /dev/null and b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..9b1e201
Binary files /dev/null and b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_1_closure3.class b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_1_closure3.class
new file mode 100644
index 0000000..21b8885
Binary files /dev/null and b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_1_closure3.class differ
diff --git a/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_2_closure4.class b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_2_closure4.class
new file mode 100644
index 0000000..39bef19
Binary files /dev/null and b/exercises/target/test-classes/main/ReplaySubjectTest$__spock_feature_0_2_closure4.class differ
diff --git a/exercises/target/test-classes/main/ReplaySubjectTest.class b/exercises/target/test-classes/main/ReplaySubjectTest.class
new file mode 100644
index 0000000..3b4cb1b
Binary files /dev/null and b/exercises/target/test-classes/main/ReplaySubjectTest.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..a828248
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..b5099c2
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure3.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure3.class
new file mode 100644
index 0000000..f368ab2
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure3.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure4.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure4.class
new file mode 100644
index 0000000..64381e9
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_0_closure4.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure5.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure5.class
new file mode 100644
index 0000000..a41ff01
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure5.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure6.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure6.class
new file mode 100644
index 0000000..14159ca
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure6.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure7.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure7.class
new file mode 100644
index 0000000..b7a35fc
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure7.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure8.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure8.class
new file mode 100644
index 0000000..0a43ecb
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_1_closure8.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure10.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure10.class
new file mode 100644
index 0000000..090df31
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure10.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure11.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure11.class
new file mode 100644
index 0000000..b01b5d3
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure11.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure9.class b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure9.class
new file mode 100644
index 0000000..f6a3401
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest$__spock_feature_0_2_closure9.class differ
diff --git a/exercises/target/test-classes/main/TransitionToObservableTest.class b/exercises/target/test-classes/main/TransitionToObservableTest.class
new file mode 100644
index 0000000..87c58ac
Binary files /dev/null and b/exercises/target/test-classes/main/TransitionToObservableTest.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure1.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure1.class
new file mode 100644
index 0000000..00eabb4
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure1.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure2.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure2.class
new file mode 100644
index 0000000..7dfd76c
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure2.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure3.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure3.class
new file mode 100644
index 0000000..54e4cb0
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_0_closure3.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure4.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure4.class
new file mode 100644
index 0000000..a85f184
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure4.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure5.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure5.class
new file mode 100644
index 0000000..a2d9621
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_1_closure5.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_2_closure6.class b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_2_closure6.class
new file mode 100644
index 0000000..3c56c28
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest$__spock_feature_0_2_closure6.class differ
diff --git a/exercises/target/test-classes/main/UnsubscribingTest.class b/exercises/target/test-classes/main/UnsubscribingTest.class
new file mode 100644
index 0000000..33f8c96
Binary files /dev/null and b/exercises/target/test-classes/main/UnsubscribingTest.class differ