package com.example;

import rx.Observable;

public class Main {

	private static void helloWorld(String... names) {
		Observable.from(names).subscribe((name) -> {
			System.out.println("Hello " + name + "!");
		});
	}

	public static void main(String... args) {
		helloWorld(new String[] { "Alice", "Bob", "Charles", });
	}

}

@@ -15,16 +15,145 @@
 ample;%0A%0A
+import static java.util.Comparator.nullsLast;%0Aimport static java.util.Comparator.reverseOrder;%0A%0Aimport java.util.stream.Stream;%0A%0A
 import r
@@ -239,16 +239,65 @@
 ames) %7B%0A
+%09%09System.out.println(%22%5Cn--- helloWorld ---%5Cn%22);%0A%0A
 %09%09Observ
@@ -327,14 +327,12 @@
 ibe(
-(
 name
-)
  -%3E 
@@ -389,16 +389,519 @@
 %7D);%0A%09%7D%0A%0A
+%09private static void syncObservable() %7B%0A%09%09System.out.println(%22%5Cn--- syncObservable ---%5Cn%22);%0A%0A%09%09Observable%3CString%3E observable = Observable.create(subscriber -%3E %7B%0A%09%09%09Stream.of(%22Alice%22, %22Bob%22, null, %22Charles%22)%0A%09%09%09%09%09.sorted(nullsLast(reverseOrder())).forEach(name -%3E %7B%0A%09%09%09%09%09%09if (!subscriber.isUnsubscribed()) %7B%0A%09%09%09%09%09%09%09subscriber.onNext(%22Hello %22 + name + %22!%22);%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D);%0A%09%09%09if (!subscriber.isUnsubscribed()) %7B%0A%09%09%09%09subscriber.onCompleted();%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09observable.subscribe(System.out::println);%0A%09%7D%0A%0A
 %09public 
@@ -990,18 +990,38 @@
 arles%22, %7D);%0A
+%09%09syncObservable();%0A
 %09%7D%0A%0A%7D%0A

add synchronous ovservable example