### Question:
ManifestAppVersionStrategy extends AbstractAppVersionStrategy { @Override public boolean canHandle(String[] args) { return args != null && (args.length == 2 || args.length == 3) && recognizes(args[0]); } ManifestAppVersionStrategy(); @Override boolean canHandle(String[] args); @Override String resolveAppVersion(Collection<File> codeBases, String[] args);  }### Answer:
@Test public void should_not_handle_unknown_strategy_name() { String args[] = {"foobar", "foobar.jar"}; assertThat(strategy.canHandle(args), is(false)); }
@Test public void should_not_handle_when_missing_args() { String args[] = {"manifest"}; assertThat(strategy.canHandle(args), is(false)); }
@Test public void should_handle_when_one_arg() { String args[] = {"manifest", "filename"}; assertThat(strategy.canHandle(args), is(true)); }
@Test public void should_handle_when_two_args() { String args[] = {"manifest", "filename", "attribute"}; assertThat(strategy.canHandle(args), is(true)); }
@Test public void should_not_handle_too_many_args() { String args[] = {"manifest", "filename", "attribute1", "attribute2"}; assertThat(strategy.canHandle(args), is(false)); }