Using REST in Java