AbstractVariableHeightLogicHandler implements ClassicBarcodeLogicHandler { public void setTextAlignment(TextAlignment align) { if (align == null) { throw new NullPointerException("align must not be null"); } this.textAlignment = align; } AbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean, Canvas canvas); void setTextAlignment(TextAlignment align); @Override void startBarcode(String msg, String formattedMsg); @Override void endBarcode(); @Override void startBarGroup(BarGroup barGroup, String string); @Override void endBarGroup();  }
@Test public void testSetTextAlignment() { System.out.println("setTextAlignment"); TextAlignment align = TextAlignment.TA_CENTER; instance.setTextAlignment(align); assertTrue("void method should not throw an exception", true); }
@Test(expected = NullPointerException.class) public void testSetTextAlignmentFail() { System.out.println("setTextAlignment"); TextAlignment align = null; instance.setTextAlignment(align); }