### Question:
KMSACLs implements Runnable, KeyACLs { public boolean hasAccess(Type type, UserGroupInformation ugi) { boolean access = acls.get(type).isUserAllowed(ugi); if (LOG.isDebugEnabled()) { LOG.debug("Checking user [{}] for: {} {} ", ugi.getShortUserName(), type.toString(), acls.get(type).getAclString()); } if (access) { AccessControlList blacklist = blacklistedAcls.get(type); access = (blacklist == null) || !blacklist.isUserInList(ugi); if (LOG.isDebugEnabled()) { if (blacklist == null) { LOG.debug("No blacklist for {}", type.toString()); } else if (access) { LOG.debug("user is not in {}" , blacklist.getAclString()); } else { LOG.debug("user is in {}" , blacklist.getAclString()); } } } if (LOG.isDebugEnabled()) { LOG.debug("User: [{}], Type: {} Result: {}", ugi.getShortUserName(), type.toString(), access); } return access; } KMSACLs(Configuration conf);  KMSACLs(); @Override void run(); synchronized void startReloader(); synchronized void stopReloader(); boolean hasAccess(Type type, UserGroupInformation ugi); void assertAccess(KMSACLs.Type aclType,
      UserGroupInformation ugi, KMSOp operation, String key); @Override boolean hasAccessToKey(String keyName, UserGroupInformation ugi,
      KeyOpType opType); @Override boolean isACLPresent(String keyName, KeyOpType opType); static final String ACL_DEFAULT; static final int RELOADER_SLEEP_MILLIS; }### Answer:
@Test public void testDefaults() { final KMSACLs acls = new KMSACLs(new Configuration(false)); for (KMSACLs.Type type : KMSACLs.Type.values()) { Assert.assertTrue(acls.hasAccess(type, UserGroupInformation.createRemoteUser("foo"))); } }
@Test public void testCustom() { final Configuration conf = new Configuration(false); for (KMSACLs.Type type : KMSACLs.Type.values()) { conf.set(type.getAclConfigKey(), type.toString() + " "); } final KMSACLs acls = new KMSACLs(conf); for (KMSACLs.Type type : KMSACLs.Type.values()) { Assert.assertTrue(acls.hasAccess(type, UserGroupInformation.createRemoteUser(type.toString()))); Assert.assertFalse(acls.hasAccess(type, UserGroupInformation.createRemoteUser("foo"))); } }