### Question:
ConfigManager { public <T> T getConfig(Class<T> clazz) { if (!Modifier.isPublic(clazz.getModifiers())) { throw new RuntimeException("Non-public configuration classes can't have default methods invoked"); } T t = (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class<?>[] { clazz }, handler); return t; } @Inject  ConfigManager(ScheduledExecutorService scheduledExecutorService); final void switchSession(AccountSession session); void load(); void importLocal(); T getConfig(Class<T> clazz); List<String> getConfigurationKeys(String prefix); String getConfiguration(String groupName, String key); T getConfiguration(String groupName, String key, Class<T> clazz); void setConfiguration(String groupName, String key, String value); void setConfiguration(String groupName, String key, Object value); void unsetConfiguration(String groupName, String key); ConfigDescriptor getConfigDescriptor(Object configurationProxy); void setDefaultConfiguration(Object proxy, boolean override); void sendConfig();  }### Answer:
@Test public void testGetConfig() throws IOException { AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now()); accountSession.setUsername("test"); manager.setConfiguration("test", "key", "moo"); TestConfig conf = manager.getConfig(TestConfig.class); Assert.assertEquals("moo", conf.key()); }
@Test public void testGetConfigDefault() throws IOException { AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now()); accountSession.setUsername("test"); TestConfig conf = manager.getConfig(TestConfig.class); Assert.assertEquals("default", conf.key()); }
@Test public void testSetConfig() throws IOException { AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now()); accountSession.setUsername("test"); TestConfig conf = manager.getConfig(TestConfig.class); conf.key("new value"); Assert.assertEquals("new value", conf.key()); }