### Question:
StdCouchDbInstance implements CouchDbInstance { @Override public <T> T getConfiguration(final Class<T> c) { return getConfiguration(c, null, null); } StdCouchDbInstance(HttpClient client);  StdCouchDbInstance(HttpClient client, ObjectMapperFactory of); ObjectMapperFactory getObjectMapperFactory(); void createDatabase(String path); void createDatabase(DbPath db); boolean createDatabaseIfNotExists(String path); boolean createDatabaseIfNotExists(final DbPath db); void deleteDatabase(String path); @Override boolean checkIfDbExists(String path); @Override boolean checkIfDbExists(DbPath db); List<String> getAllDatabases(); ReplicationStatus replicate(ReplicationCommand cmd); HttpClient getConnection(); CouchDbConnector createConnector(String path,
			boolean createIfNotExists); @Override CouchDbConnector getReplicatorConnector(); @Override T getConfiguration(final Class<T> c); @Override T getConfiguration(final Class<T> c, String section); @Override T getConfiguration(final Class<T> c, String section, String key); @Override String getConfiguration(String section, String key); @Override String setConfiguration(String section, String key, String value); @Override String deleteConfiguration(String section, String key); @Override Collection<ActiveTask> getActiveTasks();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testGetFullConfiguration() { when(client.get("/_config")).thenReturn(HttpResponseStub.valueOf(200, "{\"httpd\": {" + "\"bind_address\": \"0.0.0.0\",\"port\": \"5984\"}, \"ssl\": {\"port\": \"6984\"}}")); Map<String,Object> config = instance.getConfiguration(Map.class); assertEquals(2, config.keySet().size()); }
@Test @SuppressWarnings("unchecked") public void testGetConfigurationSection() { when(client.get("/_config/httpd")).thenReturn(HttpResponseStub.valueOf(200, "{\"httpd\": {" + "\"bind_address\": \"0.0.0.0\",\"port\": \"5984\"}}")); Map<String,Object> config = instance.getConfiguration(Map.class, "httpd"); assertEquals(1, config.keySet().size()); }
@Test public void testGetConfigurationValue() { when(client.get("/_config/httpd/port")).thenReturn(HttpResponseStub.valueOf(200, "\"5984\"")); String config = instance.getConfiguration(String.class, "httpd", "port"); assertEquals("5984", config); }