### Question:
OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; }  @Override Map<String, Object> getCapabilities(); @Override String getNamespace(); static final String NAMESPACE; }### Answer:
@Test public void testNull() throws Exception { registerOakDescriptorSource(); assertNotNull(source.getCapabilities()); assertNull(source.getCapabilities().get("foo")); }
@Test public void testDefaultJcrDescriptors_listed() throws Exception { registerOakDescriptorSource(Repository.REP_NAME_DESC, Repository.REP_VENDOR_DESC); assertNotNull(source.getCapabilities()); assertEquals("Apache Jackrabbit Oak", source.getCapabilities().get(Repository.REP_NAME_DESC)); assertEquals("The Apache Software Foundation", source.getCapabilities().get(Repository.REP_VENDOR_DESC)); }
@Test public void testDefaultJcrDescriptors_filtered() throws Exception { registerOakDescriptorSource(Repository.REP_NAME_DESC); assertNotNull(source.getCapabilities()); assertEquals("Apache Jackrabbit Oak", source.getCapabilities().get(Repository.REP_NAME_DESC)); assertNull(source.getCapabilities().get(Repository.REP_VENDOR_DESC)); }