e.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, 8);
e.getStyle().setStyleProperty(TextStyleKeys.FONT, "Tahoma");
final Object value = e.getElementType().getValue(new DebugExpressionRuntime(), e);
assertTrue(value instanceof BarcodeWrapper);
final BarcodeWrapper w = (BarcodeWrapper) value;
w.setStyleSheet(e.getStyle());
final Barcode barcode = w.getBarcode();
final Field barWidth = Barcode.class.getDeclaredField("barWidth");
barWidth.setAccessible(true);
final Field barHeight = Barcode.class.getDeclaredField("barHeight");
barHeight.setAccessible(true);
assertEquals(1, barWidth.get(barcode));
assertEquals(18, barHeight.get(barcode));
assertEquals(new Dimension(132, 18), w.getPreferredSize());
}