MultiStatusResponse { public int responseCount() { return responses.size(); } MultiStatusResponse(Map<String, Integer> responses); static MultiStatusResponse fromJson(ObjectMapper mapper, InputStream stream); Map<String, Integer> getResponses(); int responseCount(); boolean isAllSuccess(); boolean hasResourceId(String resId); int getStatus(String resId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testSize() { Map<String, Integer> responses = new HashMap<>(); responses.put("r1", 200); responses.put("r2", 300); responses.put("r3", 400); MultiStatusResponse response = new MultiStatusResponse(responses); assertThat(response.responseCount()).isEqualTo(3); }
@Test public void testDefensiveCopyOnCreation() { Map<String, Integer> responses = new HashMap<>(); responses.put("r1", 1); MultiStatusResponse multiResponse = new MultiStatusResponse(responses); responses.put("r2", 2); assertThat(multiResponse.responseCount()).isEqualTo(1); }