@Test
public void testPrefSize() {

    JXTitledSeparator separator = new JXTitledSeparator();
    Dimension dim = separator.getPreferredSize();
    separator.setTitle("some title definitely longer than empty");
    assertTrue(dim.width < separator.getPreferredSize().width);
}