ErrorAttachmentLog extends AbstractLog { public static ErrorAttachmentLog attachmentWithBinary(byte[] data, String fileName, String contentType) { ErrorAttachmentLog attachmentLog = new ErrorAttachmentLog(); attachmentLog.setData(data); attachmentLog.setFileName(fileName); attachmentLog.setContentType(contentType); return attachmentLog; }  static ErrorAttachmentLog attachmentWithText(String text, String fileName); static ErrorAttachmentLog attachmentWithBinary(byte[] data, String fileName, String contentType); @Override String getType(); UUID getId(); void setId(UUID id); UUID getErrorId(); void setErrorId(UUID errorId); String getContentType(); @SuppressWarnings("WeakerAccess") void setContentType(String contentType); String getFileName(); @SuppressWarnings("WeakerAccess") void setFileName(String fileName); byte[] getData(); void setData(byte[] data); boolean isValid(); @SuppressWarnings("ConstantConditions") @Override void read(JSONObject object); @Override void write(JSONStringer writer); @SuppressWarnings({"SimplifiableIfStatement", "EqualsReplaceableByObjectsCall"}) @Override boolean equals(Object o); @Override int hashCode(); @SuppressWarnings("WeakerAccess")
    static final String CONTENT_TYPE_TEXT_PLAIN; static final String TYPE; }
@Test public void attachmentWithBinary() { byte[] data = "Hello Binary!".getBytes(); String fileName = "binary.txt"; String contentType = "image/jpeg"; ErrorAttachmentLog attachment = ErrorAttachmentLog.attachmentWithBinary(data, fileName, contentType); assertNotNull(attachment); assertEquals(data, attachment.getData()); assertEquals(fileName, attachment.getFileName()); assertEquals(contentType, attachment.getContentType()); }