Sramp 507

https://issues.jboss.org/browse/SRAMP-507
This block appears in a few different places -- pull it into a static util?