### Question:
InvalidClassFileProblem extends ArtifactProblem { @Override public String toString() { int classFileCount = classFileNames.size(); String classFileDescription; if (classFileCount == 1) { classFileDescription = "an invalid class file " + classFileNames.get(0) + "."; } else { classFileDescription = classFileCount + " invalid class files (example: " + classFileNames.get(0) + ")."; } return artifact + " contains " + classFileDescription + " Dependency path: " + getPath(); } InvalidClassFileProblem(List<DependencyNode> dependencyPath, List<String> classFileNames); @Override String toString();  }### Answer:
@Test public void testToString_oneInvalidClassFileInArtifact() { InvalidClassFileProblem problemOneClass = new InvalidClassFileProblem( ImmutableList.of(nodeA, nodeB, nodeC), ImmutableList.of("foo.bar.Class")); assertEquals( "foo:c:jar:1.0.0 contains an invalid class file foo.bar.Class. " + "Dependency path: " + "foo:a:jar:1.0.0 (compile) > foo:b:jar:1.0.0 (provided) > foo:c:jar:1.0.0 (runtime)", problemOneClass.toString()); }
@Test public void testToString_invalidClassFilesInArtifact() { InvalidClassFileProblem problemTwoClasses = new InvalidClassFileProblem( ImmutableList.of(nodeA, nodeB, nodeC), ImmutableList.of("foo.bar.Class1", "foo.bar.Class2")); assertEquals( "foo:c:jar:1.0.0 contains 2 invalid class files (example: foo.bar.Class1). " + "Dependency path: " + "foo:a:jar:1.0.0 (compile) > foo:b:jar:1.0.0 (provided) > foo:c:jar:1.0.0 (runtime)", problemTwoClasses.toString()); }