@Test
 public void testInstrumentationModernClassFile() throws Exception {
   ClassVisitor classVisitor =
       TypeConstantAdjustment.INSTANCE.wrap(
           mock(TypeDescription.class),
           this.classVisitor,
           mock(Implementation.Context.class),
           mock(TypePool.class),
           new FieldList.Empty<FieldDescription.InDefinedShape>(),
           new MethodList.Empty<MethodDescription>(),
           IGNORED,
           IGNORED);
   classVisitor.visit(
       ClassFileVersion.JAVA_V5.getMinorMajorVersion(), FOOBAR, FOO, BAR, QUX, new String[] {BAZ});
   assertThat(
       classVisitor.visitMethod(FOOBAR, FOO, BAR, QUX, new String[] {BAZ}), is(methodVisitor));
   verify(this.classVisitor)
       .visit(
           ClassFileVersion.JAVA_V5.getMinorMajorVersion(),
           FOOBAR,
           FOO,
           BAR,
           QUX,
           new String[] {BAZ});
   verify(this.classVisitor).visitMethod(FOOBAR, FOO, BAR, QUX, new String[] {BAZ});
   verifyNoMoreInteractions(this.classVisitor);
   verifyZeroInteractions(methodVisitor);
 }
 @Test
 public void testInstrumentationLegacyClassFileArrayType() throws Exception {
   ClassVisitor classVisitor =
       TypeConstantAdjustment.INSTANCE.wrap(
           mock(TypeDescription.class),
           this.classVisitor,
           mock(Implementation.Context.class),
           mock(TypePool.class),
           new FieldList.Empty<FieldDescription.InDefinedShape>(),
           new MethodList.Empty<MethodDescription>(),
           IGNORED,
           IGNORED);
   classVisitor.visit(
       ClassFileVersion.JAVA_V4.getMinorMajorVersion(), FOOBAR, FOO, BAR, QUX, new String[] {BAZ});
   MethodVisitor methodVisitor =
       classVisitor.visitMethod(FOOBAR, FOO, BAR, QUX, new String[] {BAZ});
   assertThat(methodVisitor, not(this.methodVisitor));
   methodVisitor.visitLdcInsn(Type.getType(Object[].class));
   verify(this.classVisitor)
       .visit(
           ClassFileVersion.JAVA_V4.getMinorMajorVersion(),
           FOOBAR,
           FOO,
           BAR,
           QUX,
           new String[] {BAZ});
   verify(this.classVisitor).visitMethod(FOOBAR, FOO, BAR, QUX, new String[] {BAZ});
   verifyNoMoreInteractions(this.classVisitor);
   verify(this.methodVisitor)
       .visitLdcInsn(Type.getType(Object[].class).getInternalName().replace('/', '.'));
   verify(this.methodVisitor)
       .visitMethodInsn(
           Opcodes.INVOKESTATIC,
           Type.getType(Class.class).getInternalName(),
           "forName",
           Type.getType(Class.class.getDeclaredMethod("forName", String.class)).getDescriptor(),
           false);
   verifyNoMoreInteractions(this.methodVisitor);
 }
 @Test
 public void testReaderFlags() throws Exception {
   assertThat(TypeConstantAdjustment.INSTANCE.mergeReader(FOOBAR), is(FOOBAR));
 }