From google-api-java-client.samples/calendar-cmdline-sample