AttachmentUploadResult { @Override public String toString() { return "AttachmentUploadResult{" + "target=" + target + ", successfulUploads=" + successfulUploads + ", failedUploads=" + failedUploads + '}'; } AttachmentUploadResult(T target); private  AttachmentUploadResult(T target,
                                   Set<AttachmentUploadRequest.Item> successfulUploads,
                                   Map<AttachmentUploadRequest.Item, Throwable> failedUploads); static AttachmentUploadResult<T> newResult(T target,
                                        Set<AttachmentUploadRequest.Item> successfulUploads,
                                        Map<AttachmentUploadRequest.Item, Throwable> failedUploads); T getTarget(); boolean isSuccess(); Set<AttachmentUploadRequest.Item> successfulUploads(); Map<AttachmentUploadRequest.Item, Throwable> failedUploads(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { Path successPath = Paths.get("success.txt"); Path failurePath = Paths.get("error.doc"); Throwable exception = new IOException("Failed upload"); SW360Release release = new SW360Release(); release.setName("uploadTargetRelease"); AttachmentUploadResult<SW360Release> result = new AttachmentUploadResult<>(release) .addSuccessfulUpload(release, new AttachmentUploadRequest.Item(successPath, SW360AttachmentType.SCREENSHOT)) .addFailedUpload(new AttachmentUploadRequest.Item(failurePath, SW360AttachmentType.SOURCE_SELF), exception); String s = result.toString(); assertThat(s) .contains(successPath.toString(), failurePath.toString(), exception.getMessage(), release.toString()); }