How do I test Swing GUI in headless environment? Suppose I want to test this simple JButton extension