public static <T> T getMandatoryProperty(Exchange exchange, String propertyName, Class<T> type)
throws NoSuchPropertyException {
T answer = exchange.getProperty(propertyName, type);
if (answer == null) {
throw new NoSuchPropertyException(exchange, propertyName, type);
}
return answer;
}