RepositoryFacade implements Repository { @Override public boolean isStandardDescriptor(String key) { return delegate != null && delegate.isStandardDescriptor(key); } @SuppressWarnings("WeakerAccess")  RepositoryFacade(final @Nullable Repository delegate); @Override String[] getDescriptorKeys(); @Override boolean isStandardDescriptor(String key); @Override boolean isSingleValueDescriptor(String key); @Override Value getDescriptorValue(String key); @Override Value[] getDescriptorValues(String key); @Override String getDescriptor(String key); @Override Session login(Credentials credentials, String workspaceName); @Override Session login(Credentials credentials); @Override Session login(String workspaceName); @Override Session login();  }
@Test public void testIsStandardDescriptor() { final Repository mockRepository = mock(Repository.class); when(mockRepository.isStandardDescriptor(anyString())).thenReturn(false); when(mockRepository.isStandardDescriptor("SOME_KEY")).thenReturn(true); final RepositoryFacade facade = getFacade(mockRepository); assertTrue("SOME_KEY should be true", facade.isStandardDescriptor("SOME_KEY")); assertFalse("anyString key should be false", facade.isStandardDescriptor("ANOTHER_KEY")); final RepositoryFacade facadeNull = getFacade(null); assertFalse("null should return false", facadeNull.isStandardDescriptor("SOME_KEY")); }