DefaultConfiguration implements Configuration, Serializable { @Override public Configuration with(ConfigOperator operator) { return operator.operate(this); } DefaultConfiguration(ConfigurationContext configurationContext); @Override String get(String key); List<PropertyValue> getValues(String key); @Override String getOrDefault(String key, String defaultValue); @Override T getOrDefault(String key, Class<T> type, T defaultValue); @Override Map<String, String> getProperties(); @Override T get(String key, Class<T> type); @Override T get(String key, TypeLiteral<T> type); @Override T getOrDefault(String key, TypeLiteral<T> type, T defaultValue); @Override Configuration with(ConfigOperator operator); @Override T query(ConfigQuery<T> query); @Override ConfigurationContext getContext(); @Override ConfigurationSnapshot getSnapshot(Iterable<String> keys); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = NullPointerException.class) public void with_Null() { DefaultConfiguration c = new DefaultConfiguration(new MockedConfigurationContext()); c.with(null); }
@Test public void with() { DefaultConfiguration c = new DefaultConfiguration(new MockedConfigurationContext()); assertThat(c).isEqualTo(c.with(config -> config)); }