### Question:
Activities { public static Dataset datasetForBatonGesture(final long timestamp, final Resource actor, Resource... graphs) { if (null == actor) { throw new IllegalArgumentException(); } Collection<Statement> c = new LinkedList<>(); IRI activity = factory.randomIRI(); for (Resource graph : fixGraphs(graphs)) { c.add(createStatement(activity, RDF.TYPE, SmSnActivityOntology.BatonGesture, graph)); } return datasetForGesture(timestamp, activity, c, actor, graphs); }  static Dataset datasetForPointingGesture(final long timestamp,
                                                    final Resource actor,
                                                    final Resource referent,
                                                    Resource... graphs); static Dataset datasetForBatonGesture(final long timestamp,
                                                 final Resource actor,
                                                 Resource... graphs); static Dataset datasetForHandshakePulse(final long timestamp,
                                                   final Resource actor,
                                                   Resource... graphs); static Dataset datasetForHandshakeInteraction(final long timestamp,
                                                         final Resource actor1,
                                                         final Resource actor2,
                                                         Resource... graphs); static Dataset datasetForHandoffInteraction(final long timestamp,
                                                       final Resource giver,
                                                       final Resource taker,
                                                       final Resource thingGiven,
                                                       Resource... graphs); static Dataset datasetForHighFiveInteraction(final long timestamp,
                                                        final Resource actor1,
                                                        final Resource actor2,
                                                        Resource... graphs); static Dataset datasetForAttentionActivity(final long timestamp,
                                                      final Resource actor,
                                                      final Resource focusOfAttention,
                                                      Resource... graphs); static final SimpleDateFormat TIMESTAMP_FORMAT; static final String QUERY_FOR_ALL_GB_GESTURES; static final String QUERY_FOR_ATTENTION; static final String QUERY_FOR_REFERENTS; static final String QUERY_FOR_REFERENTS_WITH_COMMON_ORG; static final String QUERY_FOR_REFERENTS_WITH_COMMON_INTEREST; }### Answer:
@Test public void testDatasetForGestureEvent() throws Exception { RDFContentLanguage format = null; for (RDFContentLanguage l : f.getSupportedLanguages()) { if (RDFFormat.NTRIPLES.equals(l.getFormat())) { format = l; } } Dataset ds = Activities.datasetForBatonGesture(System.currentTimeMillis(), valueFactory.createIRI(agentIri)); assertEquals(5, ds.getStatements().size()); if (null != format) { f.write(System.out, ds, format); } Sail sail = new MemoryStore(); sail.initialize(); f.addToSail(ds, sail); ParsedQuery q = QueryParserUtil.parseQuery( QueryLanguage.SPARQL, Activities.QUERY_FOR_ALL_GB_GESTURES, "http: SailConnection sc = sail.getConnection(); try { sc.begin(); CloseableIteration<? extends BindingSet, QueryEvaluationException> iter = sc.evaluate(q.getTupleExpr(), q.getDataset(), new EmptyBindingSet(), false); BindingSet bs = iter.next(); assertEquals(agentIri, bs.getValue("actor").stringValue()); assertTrue(bs.getValue("time") instanceof Literal); assertFalse(iter.hasNext()); iter.close(); } finally { sc.close(); } }