String () { if (isDomainExists(ourTouchBarDomain)) { removePersistentDomain(ourTouchBarDomain); if (isDomainExists(ourTouchBarDomain)) return "can't delete domain: " + ourTouchBarDomain; } final Map<String, Object> vals = new HashMap<>(); vals.put("TestNSDefaultsKey", "TestNSDefaultsValue"); vals.put("PresentationModePerApp", new HashMap<>()); createPersistentDomain(ourTouchBarDomain, vals); if (!isDomainExists(ourTouchBarDomain)) return "can't create domain: " + ourTouchBarDomain; final boolean enabled = isShowFnKeysEnabled(TEST_APP_ID); setShowFnKeysEnabled(TEST_APP_ID, !enabled); if (isShowFnKeysEnabled(TEST_APP_ID) == enabled) return "can't write " + ourTouchBarDomain + "." + ourPerAppKey + "=" + !enabled; setShowFnKeysEnabled(TEST_APP_ID, enabled); return isShowFnKeysEnabled(TEST_APP_ID) == enabled ? null : "can't write " + ourTouchBarDomain + "." + ourPerAppKey + "=" + enabled; }