JAVA API Observable implementation example