### Question:
RegisterFunction implements Runnable { @Override public void run() { checkArgument(id != null, "id cannot be null"); checkArgument(name != null, "name cannot be null"); checkArgument(functionFile != null, "function file cannot be null"); try { byte[] bytes = Files.readAllBytes(functionFile.toPath()); long registeredAt = System.currentTimeMillis(); functionManager.register(new FunctionEntry(id, name, bytes, registeredAt)); terminal.println("Function '" + id + "' successfully registered"); } catch (IOException e) { throw new RegistryIOException("could not register function " + id); } } @Inject  RegisterFunction(TerminalWrapper terminal, FunctionManager functionManager); @Override void run();  }### Answer:
@Test public void run_ProperContractGiven_ShouldRegisterSuccessfully() throws IOException { String id = "id"; String canonicalName = "canonical"; byte[] bytes = Files.readAllBytes(file.toPath()); CommandLine.run(registerFunction, id, canonicalName, file.getAbsolutePath()); verify(manager).register(argThat(new FunctionEntryMatcher(id, canonicalName, bytes))); }