Examples Java code