private Statement withPotentialTimeout(FrameworkMethod testMethod,
Object test, Statement next) {
Long timeout = (Long) getAnnotationValue(testMethod.getAnnotation(Test.class.getName()), "timeout");
if (timeout != null && timeout > 0) {
return new FailOnTimeoutStatement(next, timeout);
} else {
return next;
}
}