// }
@SuppressWarnings("unchecked")
public static <T extends VoltProcedure> T getCurrentVoltProcedure(PartitionExecutor executor, Class<T> expectedType) {
int tries = 3;
VoltProcedure voltProc = null;
while (tries-- > 0) {
voltProc = executor.getDebugContext().getCurrentVoltProcedure();
if (voltProc != null) break;
ThreadUtil.sleep(NOTIFY_TIMEOUT);
} // WHILE
assertNotNull(String.format("Failed to get %s from %s", expectedType, executor), voltProc);
assertEquals(expectedType, voltProc.getClass());
return ((T)voltProc);
}