### Question:
AbstractCommand implements Command, Runnable { protected void checkSha1(String sha1) { if (!gitUtils.isSha1(sha1)) { throw new IllegalArgumentException(String.format("%s isn't a valid 40 bytes SHA1", sha1)); } } AbstractCommand(Context ctx); abstract C command(String command); @Override void setInputStream(InputStream in); @Override void setOutputStream(OutputStream out); @Override void setErrorStream(OutputStream err); @Override void setExitCallback(ExitCallback callback); @Override void start(Environment env); void addEndCallback(EndCallback<C> callback); @Override void destroy();  }### Answer:
@Test public void testCheckSha1_valid() { cmd.checkSha1("012340abcdef2340123401234012340123401234"); }
@Test(expected=IllegalArgumentException.class) public void testCheckSha1_invalid() { cmd.checkSha1("01234012340gh340123401234012340123401234"); }