public static MultivaluedMap<String, String> asStringHeaders(final MultivaluedMap<String, Object> headers) {
if (headers == null) {
return null;
}
final RuntimeDelegate rd = RuntimeDelegate.getInstance();
return new AbstractMultivaluedMap<String, String>(
Maps.transformValues(headers, new Function<List<Object>, List<String>>() {
@Override
public List<String> apply(List<Object> input) {
return HeadersFactory.asStringList(input, rd);