### Question:
DpEntry implements
		Comparable<DpEntry<? extends ChartStyle>>, Serializable,
		ExportableLayer { public Double getQuality() { if (isBroken()) return 0.; if (quality == null || (System.currentTimeMillis() - qualityLastTimeCalculated) > 500) { qualityLastTimeCalculated = System.currentTimeMillis(); final List<String> languages = getAtlasConfig().getLanguages(); Double averageChartQuality = 1.; if (getCharts().size() > 0) { averageChartQuality = getAverageChartQuality(); } quality = (I18NUtil.qmTranslation(languages, getTitle()) * 4. + I18NUtil.qmTranslation(languages, getDesc()) * 2. + I18NUtil.qmTranslation(languages, getKeywords()) * 1. + averageChartQuality * 3.) / 10.; } return quality; } DpEntry(AtlasConfig ac); boolean isBroken(); void setBrokenException(Exception e); Exception getBrokenException(); List<CHART_STYLE_IMPL> getCharts(); CHART_STYLE_IMPL getChartForID(String chartId); void uncache(); void setDataDirname(String folder); String getDataDirname(); @Override String toString(); @Override int compareTo(DpEntry dpe2); abstract boolean isLayer(); final String getId(); final void setId(String id); final Translation getTitle(); final void setTitle(Translation title); final Translation getDesc(); final void setDesc(Translation desc); final String getFilename(); final String getBaseFilename(); final void setFilename(File file); final void setFilename(String filename); final AtlasConfig getAtlasConfig(); final void setAtlasConfig(AtlasConfig ac); Translation getKeywords(); void setKeywords(Translation keywords); boolean isDisposed(); ImageIcon getImageIcon(); void setImageIcon(ImageIcon imageIcon); @Override Boolean isExportable(); void setExportable(boolean b); static void cleanupTemp(); boolean isDownloadedAndVisible(); Double getQuality(); Double getAverageChartQuality(); Double getChartQuality(ChartStyle Chart); final void setType(DpEntryType type); final DpEntryType getType(); Charset getCharset(); void setCharset(Charset newCharset); @Deprecated URL getUrl(); @Override boolean equals(Object obj); @Override int hashCode(); void setLocalTempFile(File localTempFile); File getLocalTempFile(); abstract String getInternalLink(); abstract String getInternalLink(String lang); public URL url; final static DataFlavor INFO_FLAVOR; }### Answer:
@Test public void testGetQuality() throws AtlasException, FactoryException, TransformException, SAXException, IOException, ParserConfigurationException { AtlasConfigEditable atlasConfig = GpTestingUtil .getAtlasConfigE(GpTestingUtil.TestAtlas.small); DataPool dataPool = atlasConfig.getDataPool(); int dpeWithChartCount = 0; for (DpEntry<? extends ChartStyle> dpe : dataPool.values()) { if (dpe.getCharts().size() > 0) { dpeWithChartCount++; Double quality = dpe.getQuality(); assertTrue("quality has to be between 0 and 1", quality >= 0.); assertTrue("quality has to be between 0 and 1", quality <= 1.); dpe.getCharts().clear(); Double quality2 = dpe.getQuality(); assertTrue(quality != quality2); } } assertEquals("The chart demo atlas contains one layer with charts ", 1, dpeWithChartCount); atlasConfig.deleteAtlas(); }