### Question:
CheckRecordComponentAdapter extends RecordComponentVisitor { @Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { checkVisitEndNotCalled(); int sort = new TypeReference(typeRef).getSort(); if (sort != TypeReference.FIELD) { throw new IllegalArgumentException( "Invalid type reference sort 0x" + Integer.toHexString(sort)); } CheckClassAdapter.checkTypeRef(typeRef); CheckMethodAdapter.checkDescriptor(Opcodes.V1_5, descriptor, false); return new CheckAnnotationAdapter( super.visitTypeAnnotation(typeRef, typePath, descriptor, visible)); } CheckRecordComponentAdapter(final RecordComponentVisitor recordComponentVisitor); protected  CheckRecordComponentAdapter(
      final int api, final RecordComponentVisitor recordComponentVisitor); @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 testVisitTypeAnnotation_illegalTypeAnnotation() { CheckRecordComponentAdapter checkRecordComponentAdapter = new CheckRecordComponentAdapter(null); Executable visitTypeAnnotation = () -> checkRecordComponentAdapter.visitTypeAnnotation( TypeReference.newFormalParameterReference(0).getValue(), null, "LA;", true); Exception exception = assertThrows(IllegalArgumentException.class, visitTypeAnnotation); assertEquals("Invalid type reference sort 0x16", exception.getMessage()); }