### Question:
AbstractBaseLauncher implements RunnableLauncher { int getPort() { LOGGER.entering(); int val = -1; InstanceType type = getType(); if (commands.contains(PORT_ARG)) { val = Integer.parseInt(commands.get(commands.indexOf(PORT_ARG) + 1)); LOGGER.exiting(val); return val; } try { if (type.equals(InstanceType.SELENIUM_NODE) || type.equals(InstanceType.SELENIUM_HUB)) { val = getSeleniumConfigAsJsonObject().get("port").getAsInt(); } } catch (JsonParseException | NullPointerException e) { } val = (val != -1) ? val : 4444; LOGGER.exiting(val); return val; }  final boolean isInitialized(); boolean isRunning();  }### Answer:
@Test public void testGetPort() { DummyProcessLauncher launcher; launcher = new DummyProcessLauncher(); assertEquals(launcher.getPort(), 4444); launcher = new DummyProcessLauncher(new String[] { ROLE_ARG, "hub" }); assertEquals(launcher.getPort(), 4444); launcher = new DummyProcessLauncher(new String[] { ROLE_ARG, "hub", HUB_CONFIG_ARG, HUB_CONFIG_FILE }); assertEquals(launcher.getPort(), 4444); launcher = new DummyProcessLauncher(new String[] { ROLE_ARG, "node" }); assertEquals(launcher.getPort(), 5555); launcher = new DummyProcessLauncher(new String[] { ROLE_ARG, "node", NODE_CONFIG_ARG, NODE_CONFIG_FILE }); assertEquals(launcher.getPort(), 5555); launcher = new DummyProcessLauncher(new String[] { "-port", "1234" }); assertEquals(launcher.getPort(), 1234); }