// With all configuration complete, connect to the environment.
LocalEnvironment env = getEnvironment();
env.connect();
// Run the query.
QuerySubmitResponse response = env.submitQuery(query, getQueryOpts());
FlowId id = response.getFlowId();
assertNotNull(response.getMessage(), id);
joinFlow(id);
// Examine the response records.