ElmLink implements ObdLink { @Override public CommandResult sendCommand(ObdCommand command) { String commandData = commandMarshaller.marshal(command); String commandResultData = transport.sendDataAndReadResponse(commandData); return commandUnmarshaller.unmarshal(command, commandResultData); } ElmLink(InputStream inputStream, OutputStream outputStream);  ElmLink(ElmTransport transport);  ElmLink(ElmTransport transport, CommandMarshaller commandMarshaller, CommandUnmarshaller commandUnmarshaller); @Override CommandResult sendCommand(ObdCommand command);  }
@Test public void invokeShouldMarshalCommandAndUnmarshalResponse() throws Exception { CommandResult commandResult = sut.sendCommand(obdCommandMock); assertThat(commandResult).isEqualTo(commandResultMock); }