LazyProperties extends Properties { @Override public Set<Map.Entry<String, Object>> entrySet() { return properties.entrySet(); } LazyProperties(final Properties properties, final ElementValueLoader valueLoader); Properties getProperties(); @Override Object put(final String name, final Object property); @Override void putAll(final Map<? extends String, ?> newProperties); @SuppressWarnings("CloneDoesntCallSuperClone") @SuppressFBWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "Doesn't use any properties in super class") @Override LazyProperties clone(); @Override Object get(final Object name); Object get(final String name); @Override void clear(); @Override Object remove(final Object name); @Override void keepOnly(final Collection<String> propertiesToKeep); @Override void remove(final Collection<String> propertiesToRemove); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(final Object key); @Override boolean containsValue(final Object value); @Override Set<String> keySet(); @Override Collection<Object> values(); @Override Set<Map.Entry<String, Object>> entrySet(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void shouldDelegateEntrySetMethodToPropertiesInstance() { final Properties properties = mock(Properties.class); final LazyProperties lazyProperties = new LazyProperties(properties, null); final Set<Map.Entry<String, Object>> expectedEntrySet = mock(Set.class); given(properties.entrySet()).willReturn(expectedEntrySet); final Set<Map.Entry<String, Object>> entrySet = lazyProperties.entrySet(); assertSame(expectedEntrySet, entrySet); }