### Question:
SakuliStarter { protected static void checkAndAssignEncryptionOptions(String masterkey, String ethInterface) throws SakuliInitException { if (isNotEmpty(masterkey) && isNotEmpty(ethInterface)) { throw new SakuliInitException("Encryption setup error: Masterkey and network interface specified, please specify only one option!"); } if (isNotEmpty(masterkey)) { LOGGER.debug("set masterkey '{}' for encryption", masterkey); SakuliPropertyPlaceholderConfigurer.ENCRYPTION_KEY_VALUE = masterkey; } if (isNotEmpty(ethInterface)) { LOGGER.debug("set '{}' as encryption interface", ethInterface); SakuliPropertyPlaceholderConfigurer.ENCRYPTION_INTERFACE_VALUE = ethInterface; } }  static void main(String[] args); static TestSuite runTestSuite(String testSuiteFolderPath, String sakuliMainFolder); static TestSuite runTestSuite(String testSuiteFolderPath, String sakuliMainFolder, String browser); static TestSuite runTestSuite(String testSuiteFolderPath, String sakuliHomeFolderPath, String browser, String sahiHomeFolder); static final Logger LOGGER; }### Answer:
@Test(expectedExceptions = SakuliInitException.class, expectedExceptionsMessageRegExp = ".*Masterkey and network interface specified. please specify only one option.*") public void testDoubledEncryptionMode() throws Exception { SakuliStarter.checkAndAssignEncryptionOptions("keyvalue", "eth1"); }
@Test public void testCheckMasterkey() throws Exception { SakuliStarter.checkAndAssignEncryptionOptions("keyvalue", ""); assertNull(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_INTERFACE_VALUE); assertEquals(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_KEY_VALUE, "keyvalue"); SakuliStarter.checkAndAssignEncryptionOptions("keyvalue2", null); assertNull(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_INTERFACE_VALUE); assertEquals(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_KEY_VALUE, "keyvalue2"); }
@Test public void testCheckInterface() throws Exception { SakuliStarter.checkAndAssignEncryptionOptions("", "eth1"); assertNull(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_KEY_VALUE); assertEquals(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_INTERFACE_VALUE, "eth1"); SakuliStarter.checkAndAssignEncryptionOptions(null, "eth2"); assertNull(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_KEY_VALUE); assertEquals(SakuliPropertyPlaceholderConfigurer.ENCRYPTION_INTERFACE_VALUE, "eth2"); }