### Question:
CheckFieldAdapter extends FieldVisitor { @Override public void visitAttribute(final Attribute attribute) { checkVisitEndNotCalled(); if (attribute == null) { throw new IllegalArgumentException("Invalid attribute (must not be null)"); } super.visitAttribute(attribute); } CheckFieldAdapter(final FieldVisitor fieldVisitor); protected  CheckFieldAdapter(final int api, final FieldVisitor fieldVisitor); @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();  }### Answer:
@Test public void testVisitAttribute_illegalAttribute() { CheckFieldAdapter checkFieldAdapter = new CheckFieldAdapter(null); Executable visitAttribute = () -> checkFieldAdapter.visitAttribute(null); Exception exception = assertThrows(IllegalArgumentException.class, visitAttribute); assertEquals("Invalid attribute (must not be null)", exception.getMessage()); }