ExecutorService executor = Executors.newFixedThreadPool(1);
executor.submit(new Runnable() {
public void run() {
int times = 50;
handler.before(Arrays.asList(buildEvent()));
while (--times > 0) {
try {
Thread.sleep(50000);
} catch (InterruptedException e) {
}