DateTime fiveHrsAgo = DateTime.now().minusHours(5);
DateTime fourHrsAgo = fiveHrsAgo.plusHours(1);
String name = "My awesome Historics";
//prepare our query
PreparedHistoricsQuery query = datasift.historics().prepare(stream.hash(), fiveHrsAgo, fourHrsAgo, name).sync();
//have to create a push subscription to the newly created historics before starting
datasift.push().create(s3, FutureData.wrap(query), "Subscription name").sync();
DataSiftResult historics = datasift.historics().start(query).sync();
//stop a query
datasift.historics().stop(query, "some reason").sync();
//get a single historics query
datasift.historics().get(query.getId()).sync();
//get your list of historics
datasift.historics().list().sync();
//delete a query
datasift.historics().delete(query).sync();
}