### Question:
MethodVisitor { public void visitInvokeDynamicInsn( final String name, final String descriptor, final Handle bootstrapMethodHandle, final Object... bootstrapMethodArguments) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationException(REQUIRES_ASM5); } if (mv != null) { mv.visitInvokeDynamicInsn(name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments); } } MethodVisitor(final int api);  MethodVisitor(final int api, final MethodVisitor methodVisitor); void visitParameter(final String name, final int access); AnnotationVisitor visitAnnotationDefault(); AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible); AnnotationVisitor visitTypeAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); void visitAnnotableParameterCount(final int parameterCount, final boolean visible); AnnotationVisitor visitParameterAnnotation(
      final int parameter, final String descriptor, final boolean visible); void visitAttribute(final Attribute attribute); void visitCode(); void visitFrame(
      final int type,
      final int numLocal,
      final Object[] local,
      final int numStack,
      final Object[] stack); void visitInsn(final int opcode); void visitIntInsn(final int opcode, final int operand); void visitVarInsn(final int opcode, final int var); void visitTypeInsn(final int opcode, final String type); void visitFieldInsn(
      final int opcode, final String owner, final String name, final String descriptor); @Deprecated void visitMethodInsn(
      final int opcode, final String owner, final String name, final String descriptor); void visitMethodInsn(
      final int opcode,
      final String owner,
      final String name,
      final String descriptor,
      final boolean isInterface); void visitInvokeDynamicInsn(
      final String name,
      final String descriptor,
      final Handle bootstrapMethodHandle,
      final Object... bootstrapMethodArguments); void visitJumpInsn(final int opcode, final Label label); void visitLabel(final Label label); void visitLdcInsn(final Object value); void visitIincInsn(final int var, final int increment); void visitTableSwitchInsn(
      final int min, final int max, final Label dflt, final Label... labels); void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels); void visitMultiANewArrayInsn(final String descriptor, final int numDimensions); AnnotationVisitor visitInsnAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); void visitTryCatchBlock(
      final Label start, final Label end, final Label handler, final String type); AnnotationVisitor visitTryCatchAnnotation(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible); void visitLocalVariable(
      final String name,
      final String descriptor,
      final String signature,
      final Label start,
      final Label end,
      final int index); AnnotationVisitor visitLocalVariableAnnotation(
      final int typeRef,
      final TypePath typePath,
      final Label[] start,
      final Label[] end,
      final int[] index,
      final String descriptor,
      final boolean visible); void visitLineNumber(final int line, final Label start); void visitMaxs(final int maxStack, final int maxLocals); void visitEnd();  }### Answer:
@Test public void testVisitInvokeDynamicInsn_asm4Visitor() { MethodVisitor methodVisitor = new MethodVisitor(Opcodes.ASM4, null) {}; Executable visitInvokeDynamicInsn = () -> methodVisitor.visitInvokeDynamicInsn(null, null, null); Exception exception = assertThrows(UnsupportedOperationException.class, visitInvokeDynamicInsn); assertTrue(exception.getMessage().matches(UNSUPPORTED_OPERATION_MESSAGE_PATTERN)); }