private static Map<String, Property> getResponseHeaders(MethodResponse methodResponse) { Map<String, Property> result = null; Map<String, Boolean> responseParameters = methodResponse.getResponseParameters(); if (responseParameters != null) { for (Map.Entry<String, Boolean> responseParameterEntry : responseParameters.entrySet()) { String parameterName = responseParameterEntry.getKey(); if (parameterName.startsWith(METHOD_RESPONSE_HEADER)) { StringProperty headerProperty = new StringProperty(); headerProperty.setRequired(responseParameterEntry.getValue()); if (result == null) { result = new LinkedHashMap<String, Property>(); } result.put(parameterName.substring(METHOD_RESPONSE_HEADER.length()), headerProperty); } else { throw new UnsupportedOperationException("Unsupported response parameter type " + parameterName); } } } return result; }