### Question:
SecurityUtil { public static boolean isKerberosEnabled(CConfiguration cConf) { return cConf.getBoolean(Constants.Security.KERBEROS_ENABLED, cConf.getBoolean(Constants.Security.ENABLED)); } private  SecurityUtil(); static void enableKerberosLogin(CConfiguration cConf); @Nullable static String expandPrincipal(@Nullable String principal); static boolean isKerberosEnabled(CConfiguration cConf); static String getMasterPrincipal(CConfiguration cConf); static String getMasterKeytabURI(CConfiguration cConf); static void loginForMasterService(CConfiguration cConf); static KerberosName getKerberosName(KerberosPrincipalId principalId); static void validateKerberosPrincipal(KerberosPrincipalId principalId); static void validateKerberosPrincipal(String principal); static ImpersonationInfo createImpersonationInfo(OwnerAdmin ownerAdmin, CConfiguration cConf,
                                                          NamespacedEntityId entityId); static void verifyOwnerPrincipal(NamespacedEntityId existingEntity,
                                          @Nullable String specifiedOwnerPrincipal,
                                          OwnerAdmin ownerAdmin); @Nullable static KerberosPrincipalId getEffectiveOwner(OwnerAdmin ownerAdmin, NamespaceId namespaceId,
                                                      @Nullable String ownerPrincipal);  }### Answer:
@Test public void isKerberosEnabled() throws Exception { CConfiguration kerbConf = CConfiguration.create(); kerbConf.set(Constants.Security.KERBEROS_ENABLED, "true"); kerbConf.set(Constants.Security.CFG_CDAP_MASTER_KRB_PRINCIPAL, "prinicpal@REALM.NET"); kerbConf.set(Constants.Security.CFG_CDAP_MASTER_KRB_KEYTAB_PATH, "/path/to/keytab"); Assert.assertTrue(SecurityUtil.isKerberosEnabled(kerbConf)); CConfiguration noPrincipalConf = CConfiguration.create(); kerbConf.set(Constants.Security.KERBEROS_ENABLED, "false"); noPrincipalConf.unset(Constants.Security.CFG_CDAP_MASTER_KRB_PRINCIPAL); noPrincipalConf.set(Constants.Security.CFG_CDAP_MASTER_KRB_KEYTAB_PATH, "/path/to/keytab"); Assert.assertFalse(SecurityUtil.isKerberosEnabled(noPrincipalConf)); CConfiguration noKeyTabConf = CConfiguration.create(); kerbConf.set(Constants.Security.KERBEROS_ENABLED, "false"); noKeyTabConf.unset(Constants.Security.CFG_CDAP_MASTER_KRB_KEYTAB_PATH); noKeyTabConf.set(Constants.Security.CFG_CDAP_MASTER_KRB_PRINCIPAL, "prinicpal@REALM.NET"); Assert.assertFalse(SecurityUtil.isKerberosEnabled(noKeyTabConf)); }