Fix Java use cases