### Question:
MainChartXSettingsGenerator implements XSettingsGenerator { @Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); return judgmentGlobalFilter.getJudgmentDateRange() != null; }  @Override XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean handles(ChartCode chartCode); @Autowired void setMonthYearRangeConverter(MonthYearRangeConverter monthYearRangeConverter);  }### Answer:
@Test(expected = NullPointerException.class) public void canGenerateXSettings_NULL() { xsettingsGenerator.canGenerateXSettings(null); }
@Test public void canGenerateXSettings_FALSE() { JudgmentGlobalFilter globalFilter = new JudgmentGlobalFilter(); assertFalse(xsettingsGenerator.canGenerateXSettings(globalFilter)); }
@Test public void canGenerateXSettings_TRUE() { JudgmentGlobalFilter globalFilter = new JudgmentGlobalFilter(); globalFilter.setJudgmentDateRange(new MonthYearRange()); assertTrue(xsettingsGenerator.canGenerateXSettings(globalFilter)); }