### Question:
OperatingSystemImpl implements OperatingSystem { @Override public void run(String command) { try { Process process = Runtime.getRuntime().exec(command); int exitCode = process.waitFor(); if (exitCode != 0) { throw new RuntimeException("Command " + command + " exited with value " + exitCode); } } catch (Exception e) { throw new RuntimeException(e); } }  @Override void run(String command);  }### Answer:
@Test public void executesCommand() { String command = UUID.randomUUID().toString(); try { new OperatingSystemImpl().run(command); fail("Missing exception"); } catch (RuntimeException e) { assertNotNull("Missing cause", e.getCause()); assertEquals("Exception", IOException.class, e.getCause().getClass()); assertTrue("Exception message", e.getCause().getMessage().contains(command)); } }