Java example using Scala Observable code