### Question:
CheckClassAdapter extends ClassVisitor { public static void main(final String[] args) throws IOException { main(args, new PrintWriter(System.err, true)); } CheckClassAdapter(final ClassVisitor classVisitor);  CheckClassAdapter(final ClassVisitor classVisitor, final boolean checkDataFlow); protected  CheckClassAdapter(
      final int api, final ClassVisitor classVisitor, final boolean checkDataFlow); @Override void visit(
      final int version,
      final int access,
      final String name,
      final String signature,
      final String superName,
      final String[] interfaces); @Override void visitSource(final String file, final String debug); @Override ModuleVisitor visitModule(final String name, final int access, final String version); @Override void visitNestHost(final String nestHost); @Override void visitNestMember(final String nestMember); @Override void visitOuterClass(final String owner, final String name, final String descriptor); @Override void visitInnerClass(
      final String name, final String outerName, final String innerName, final int access); @Override FieldVisitor visitField(
      final int access,
      final String name,
      final String descriptor,
      final String signature,
      final Object value); @Override MethodVisitor visitMethod(
      final int access,
      final String name,
      final String descriptor,
      final String signature,
      final String[] exceptions); @Override AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible); @Override AnnotationVisitor visitTypeAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); @Override void visitAttribute(final Attribute attribute); @Override void visitEnd(); static void checkClassSignature(final String signature); static void checkMethodSignature(final String signature); static void checkFieldSignature(final String signature); static void main(final String[] args); static void verify(
      final ClassReader classReader, final boolean printResults, final PrintWriter printWriter); static void verify(
      final ClassReader classReader,
      final ClassLoader loader,
      final boolean printResults,
      final PrintWriter printWriter);  }### Answer:
@Test public void testMain_missingClassName() throws IOException { StringWriter logger = new StringWriter(); String[] args = new String[0]; CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertEquals(EXPECTED_USAGE, logger.toString()); }
@Test public void testMain_tooManyArguments() throws IOException { StringWriter logger = new StringWriter(); String[] args = {getClass().getName(), "extraArgument"}; CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertEquals(EXPECTED_USAGE, logger.toString()); }
@Test public void testMain_classFileNotFound() { StringWriter logger = new StringWriter(); String[] args = {"DoNotExist.class"}; Executable main = () -> CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertThrows(IOException.class, main); assertEquals("", logger.toString()); }
@Test public void testMain_classNotFound() { StringWriter logger = new StringWriter(); String[] args = {"do\\not\\exist"}; Executable main = () -> CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertThrows(IOException.class, main); assertEquals("", logger.toString()); }
@Test public void testMain_className() throws IOException { StringWriter logger = new StringWriter(); String[] args = {getClass().getName()}; CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertEquals("", logger.toString()); }
@Test public void testMain_classFile() throws IOException { StringWriter logger = new StringWriter(); String[] args = { ClassLoader.getSystemResource(getClass().getName().replace('.', '/') + ".class").getPath() }; CheckClassAdapter.main(args, new PrintWriter(logger, true)); assertEquals("", logger.toString()); }