### Question:
CheckMethodAdapter extends MethodVisitor { @Override public void visitAttribute(final Attribute attribute) { checkVisitEndNotCalled(); if (attribute == null) { throw new IllegalArgumentException("Invalid attribute (must not be null)"); } super.visitAttribute(attribute); } CheckMethodAdapter(final MethodVisitor methodvisitor);  CheckMethodAdapter(
      final MethodVisitor methodVisitor, final Map<Label, Integer> labelInsnIndices); protected  CheckMethodAdapter(
      final int api,
      final MethodVisitor methodVisitor,
      final Map<Label, Integer> labelInsnIndices);  CheckMethodAdapter(
      final int access,
      final String name,
      final String descriptor,
      final MethodVisitor methodVisitor,
      final Map<Label, Integer> labelInsnIndices); protected  CheckMethodAdapter(
      final int api,
      final int access,
      final String name,
      final String descriptor,
      final MethodVisitor methodVisitor,
      final Map<Label, Integer> labelInsnIndices); @Override void visitParameter(final String name, final int access); @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 AnnotationVisitor visitAnnotationDefault(); @Override void visitAnnotableParameterCount(final int parameterCount, final boolean visible); @Override AnnotationVisitor visitParameterAnnotation(
      final int parameter, final String descriptor, final boolean visible); @Override void visitAttribute(final Attribute attribute); @Override void visitCode(); @Override void visitFrame(
      final int type,
      final int numLocal,
      final Object[] local,
      final int numStack,
      final Object[] stack); @Override void visitInsn(final int opcode); @Override void visitIntInsn(final int opcode, final int operand); @Override void visitVarInsn(final int opcode, final int var); @Override void visitTypeInsn(final int opcode, final String type); @Override void visitFieldInsn(
      final int opcode, final String owner, final String name, final String descriptor); @Override void visitMethodInsn(
      final int opcodeAndSource,
      final String owner,
      final String name,
      final String descriptor,
      final boolean isInterface); @Override void visitInvokeDynamicInsn(
      final String name,
      final String descriptor,
      final Handle bootstrapMethodHandle,
      final Object... bootstrapMethodArguments); @Override void visitJumpInsn(final int opcode, final Label label); @Override void visitLabel(final Label label); @Override void visitLdcInsn(final Object value); @Override void visitIincInsn(final int var, final int increment); @Override void visitTableSwitchInsn(
      final int min, final int max, final Label dflt, final Label... labels); @Override void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels); @Override void visitMultiANewArrayInsn(final String descriptor, final int numDimensions); @Override AnnotationVisitor visitInsnAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); @Override void visitTryCatchBlock(
      final Label start, final Label end, final Label handler, final String type); @Override AnnotationVisitor visitTryCatchAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); @Override void visitLocalVariable(
      final String name,
      final String descriptor,
      final String signature,
      final Label start,
      final Label end,
      final int index); @Override AnnotationVisitor visitLocalVariableAnnotation(
      final int typeRef,
      final TypePath typePath,
      final Label[] start,
      final Label[] end,
      final int[] index,
      final String descriptor,
      final boolean visible); @Override void visitLineNumber(final int line, final Label start); @Override void visitMaxs(final int maxStack, final int maxLocals); @Override void visitEnd(); public int version; }### Answer:
@Test public void testVisitAttribute_nullAttribute() { Executable visitAttribute = () -> checkMethodAdapter.visitAttribute(null); Exception exception = assertThrows(IllegalArgumentException.class, visitAttribute); assertEquals("Invalid attribute (must not be null)", exception.getMessage()); }