EsperStatement implements EsperStatementOperations { public <T> T concurrentSafeQueryForObject(ParameterizedEsperRowMapper<T> rm) { LOG.info("Concurrent safe query for object being executed"); if (epStatement.isStopped() || epStatement.isDestroyed()) { LOG .error("Concurrent safe query for object was attempted when the statement was stopped or destroyed"); throw new EsperStatementInvalidStateException( "Attempted to execute a concurrent safe query for object when esper statement resource had state of " + epStatement.getState()); } SafeIterator<EventBean> safeIter = this.epStatement.safeIterator(); T result = null; try { while (safeIter.hasNext()) { EventBean event = safeIter.next(); if (!safeIter.hasNext()) { result = rm.mapRow(event); } } } finally { safeIter.close(); } LOG.info("Concurrent safe query for object was completed"); return result; } EsperStatement(String epl);  EsperStatement(String id, String epl); String getEPL(); EPStatementState getState(); void start(); void stop(); void destroy(); void doWithNativeEPStatement(NativeEPStatementCallback callback); void setListeners(Set<UpdateListener> listeners); Set<UpdateListener> getListeners(); void setSubscriber(Object subscriber); void addListener(UpdateListener listener); List<T> concurrentSafeQuery(ParameterizedEsperRowMapper<T> rm); T concurrentSafeQueryForObject(ParameterizedEsperRowMapper<T> rm); List<T> concurrentUnsafeQuery(ParameterizedEsperRowMapper<T> rm); T concurrentUnsafeQueryForObject(
			ParameterizedEsperRowMapper<T> rm); String getId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testConcurrencySafeQueryForObject() throws Exception { SampleEvent event = new SampleEvent(); template.sendEvent(event); SampleEvent result = statement.concurrentSafeQueryForObject(this.rowMapper); assertEquals(result, event); }