### Question:
PrintPayload implements Jsonable { public TextRow append(String text) { return append(text, null); } PrintPayload();  PrintPayload(String printerId); TextRow append(String text); TextRow append(String text, PrinterFont printerFont); void append(PrintPayload toAppendPayload); void appendEmptyLine(); TextRow appendLineOfChar(int columns, String character); TextRow appendLeftRight(int columns, String left, String right); ImageRow append(Bitmap image); ImageRow append(Bitmap image, boolean scaleToFit); PrintRow[] getRows(); int getCodePage(); void setCodePage(int codePage); String getLanguage(); void setLanguage(String languageCode); void setPrinterId(String printerId); String getPrinterId(); boolean hasPrinterId(); @Override String toJson(); static PrintPayload fromJson(String json);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void appendNullImageWillThrow() { PrintPayload payload = new PrintPayload(); payload.append((Bitmap) null); }
@Test(expected = IllegalArgumentException.class) public void appendNullPayloadWillThrow() { PrintPayload payload = new PrintPayload(); payload.append((PrintPayload) null); }
@Test public void canSetFont() { PrintPayload payload = new PrintPayload(); PrinterFont printerFont = new PrinterFont(56, "FontyMcFontFace", 0, 0, false, 0, 0, null); TextRow textRow = payload.append("Hello", printerFont); assertThat(textRow.getPrinterFontId()).isEqualTo(56); }
@Test public void canSetImageScale() { PrintPayload payload = new PrintPayload(); Bitmap bmp = getBitmap(); ImageRow imageRow = payload.append(bmp, true); assertThat(imageRow.isScaleToFit()).isTrue(); }
@Test(expected = IllegalArgumentException.class) public void appendNullWillThrow() { PrintPayload payload = new PrintPayload(); payload.append((String) null); }