### Question:
CatBuildCommand extends AbstractCommand<CatBuildCommand> { @Override public CatBuildCommand command(String command) throws Exception { Scanner s = new Scanner(command); s.useDelimiter("\\s{1,}"); check(s.next(), "magrit"); check(s.next(), "cat-build"); check(command, s.hasNext()); this.repository = createRepository(s.next()); check(command, s.hasNext()); checkSha1(sha1 = s.next()); return this; } CatBuildCommand(Context ctx, BuildDAO dao); @Override CatBuildCommand command(String command); @Override void run();  }### Answer:
@Test public void testCommand() throws Exception { Object o = buildCommand.command("magrit cat-build /r1 1234512345123451234512345123451234512345"); assertThat(o).isNotNull().isEqualTo(buildCommand); assertThat(buildCommand.getSha1()).isEqualTo("1234512345123451234512345123451234512345"); assertThat(buildCommand.getRepository().getDirectory().getAbsolutePath()) .isEqualTo(ctx.configuration().getRepositoriesHomeDir().getAbsolutePath() + "/r1"); }