class MultiStatusResponse {

    public static MultiStatusResponse fromJson(ObjectMapper mapper, InputStream stream) throws IOException {
        List<Map<String, Object>> responses = mapper.readValue(stream, REF_MULTI_RESPONSE);
        try {
            Map<String, Integer> responseMap = responses.stream()
                    .map(map -> new AbstractMap.SimpleEntry<>(extractResourceId(map), extractStatus(map)))
                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
            return new MultiStatusResponse(responseMap);
        } catch (IllegalArgumentException e) {
            // Status extraction failed from JSON
            throw new IOException("Failed to parse JSON response", e);
        }
    }

    public  MultiStatusResponse(Map<String, Integer> responses);

}