@Test
public void testGetDayAtLocation() {

    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    JXMonthView monthView = new JXMonthView();
    monthView.getSelectionModel().setMinimalDaysInFirstWeek(1);
    JXFrame frame = new JXFrame();
    frame.add(monthView);
    frame.pack();
    Dimension pref = monthView.getPreferredSize();
    pref.width = pref.width / 2;
    pref.height = pref.height / 2;
    Date date = monthView.getDayAtLocation(pref.width, pref.height);
    assertNotNull(date);
}