RunListener listener = new RunListener() {
WarningsCollector warningsCollector;
@Override
public void testStarted(Description description) throws Exception {
warningsCollector = new WarningsCollector();
}
@Override public void testFailure(Failure failure) throws Exception {
logger.log(warningsCollector.getWarnings());
}