### Question:
WorkerProcessCommandLine implements CommandLine { static boolean isAgentJar(final String name) { final Matcher matcher = AGENT_JAR_FILENAME_PATTERN.matcher(name); if (matcher.matches()) { final String maybeSnapshot = matcher.group(2); return maybeSnapshot == null || "-SNAPSHOT".equals(maybeSnapshot); } return false; } WorkerProcessCommandLine(final GrinderProperties properties,
                                  final Properties systemProperties,
                                  final String jvmArguments,
                                  final Directory workingDirectory); @Override Directory getWorkingDirectory(); @Override List<String> getCommandList(); @Override String toString();  }### Answer:
@Test public void testIsAgentJarValidNames() { for (final String s : asList("grinder-dcr-agent-1.jar", "grinder-dcr-agent-"+ GrinderBuild.getVersionString() + ".jar")) { assertTrue(s, WorkerProcessCommandLine.isAgentJar(s)); } }
@Test public void testIsAgentJarInvalidNames() { for (final String s : asList("grinder-dcr-agent.jar", "grinder-dcr-agent-"+ GrinderBuild.getVersionString() + ".jar.asc", "grinder-dcr-agent-" + GrinderBuild.getVersionString() + "-sources.jar", "xgrinder-dcr-agent-" + GrinderBuild.getVersionString() + ".jar")) { assertFalse(s, WorkerProcessCommandLine.isAgentJar(s)); } }