Configuration { public Date getLastUpdate() { return lastUpdate == null ? null : (Date) lastUpdate.clone(); } private  Configuration(); static Configuration instance(); static ConfigurationSource loadConfigFile(String fileName, int precedence); void addSource(ConfigurationSource source); void clearSources(); String getString(ConfigurationKey key); String getString(ConfigurationKey key, String defaultValue); String getString(String key); String getString(String key, String defaultValue); String[] getStringArray(ConfigurationKey key); String[] getStringArray(ConfigurationKey key, String[] defaultValue); BigDecimal getBigDecimal(ConfigurationKey key); BigDecimal getBigDecimal(ConfigurationKey key, BigDecimal defaultValue); Integer getInteger(ConfigurationKey key); Integer getInteger(ConfigurationKey key, Integer defaultValue); Integer getInteger(String key); Long getLong(ConfigurationKey key); Long getLong(ConfigurationKey key, Long defaultValue); Boolean getBoolean(ConfigurationKey key); Boolean getBoolean(ConfigurationKey key, Boolean defaultValue); Date getDate(ConfigurationKey key); Date getDate(ConfigurationKey key, Date defaultValue); Date getLastUpdate(); void update(); String getSummary();  }
@Test public void testGetLastUpdate() { Configuration configuration = Configuration.instance(); Assert.assertNull("New configuration without any configurationSource can not have lastUpdate set", configuration.getLastUpdate()); configuration.addSource(new DefaultConfigurationSource()); Date lastUpdate = configuration.getLastUpdate(); Assert.assertNotNull("Configuration with configurationSource must have lastUpdate set", lastUpdate); long originalTime = lastUpdate.getTime(); lastUpdate.setTime(111); Assert.assertTrue("Configuration exposed internal representation of lastUpdate property", originalTime == configuration .getLastUpdate().getTime()); }