private static BodyPart createRandomBinaryPart(int numberOfBytes)
throws IOException {
byte[] data = new byte[numberOfBytes];
new Random().nextBytes(data);
Body body = new BodyFactory()
.binaryBody(new ByteArrayInputStream(data));
BodyPart bodyPart = new BodyPart();
bodyPart.setBody(body, "application/octet-stream");
bodyPart.setContentTransferEncoding("base64");