package cz.moneta.test.harness.support.rest;

import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
import java.util.Map;

public class RestUtils {

    @SuppressWarnings("unchecked")
    public static <T> MultivaluedMap<String, T> toMultiMap(Map<String, Object> map) {
        return map.entrySet()
                .stream()
                .collect(MultivaluedHashMap::new, (m, e) -> m.putSingle(e.getKey(), (T) e.getValue()), Map::putAll);
    }

}
