@Test public void getContent_ByteArrayUsedInConstructor_ArraysAreDifferentObjects() throws Exception { assertFalse(responseObject.getContent() == byteArray); byte[] responseArray = responseObject.getContent(); byteArray = "other".getBytes(); assertFalse(Arrays.equals(responseArray, byteArray)); }
public byte[] getContent() { return content != null ? Arrays.copyOf(content, content.length) : null; }
ResponseObject { public byte[] getContent() { return content != null ? Arrays.copyOf(content, content.length) : null; } }
ResponseObject { public byte[] getContent() { return content != null ? Arrays.copyOf(content, content.length) : null; } ResponseObject(Map<String, List<String>> headers, byte[] content); }
ResponseObject { public byte[] getContent() { return content != null ? Arrays.copyOf(content, content.length) : null; } ResponseObject(Map<String, List<String>> headers, byte[] content); Map<String, List<String>> getHeaders(); byte[] getContent(); }
ResponseObject { public byte[] getContent() { return content != null ? Arrays.copyOf(content, content.length) : null; } ResponseObject(Map<String, List<String>> headers, byte[] content); Map<String, List<String>> getHeaders(); byte[] getContent();  }