@Test public void testCasting() throws Exception { when(typeDescription.getInternalName()).thenReturn(FOO); StackManipulation.Size size = new TypeCasting(typeDescription).apply(methodVisitor, implementationContext); assertThat(size.getSizeImpact(), is(0)); assertThat(size.getMaximalSize(), is(0)); verify(methodVisitor).visitTypeInsn(Opcodes.CHECKCAST, FOO); verifyNoMoreInteractions(methodVisitor); verifyZeroInteractions(implementationContext); }
public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, typeDescription.getInternalName()); return StackSize.ZERO.toIncreasingSize(); }
TypeCasting implements StackManipulation { public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, typeDescription.getInternalName()); return StackSize.ZERO.toIncreasingSize(); } }
TypeCasting implements StackManipulation { public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, typeDescription.getInternalName()); return StackSize.ZERO.toIncreasingSize(); } protected  TypeCasting(TypeDescription typeDescription); }
TypeCasting implements StackManipulation { public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, typeDescription.getInternalName()); return StackSize.ZERO.toIncreasingSize(); } protected  TypeCasting(TypeDescription typeDescription); static StackManipulation to(TypeDefinition typeDefinition); boolean isValid(); Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext); }
TypeCasting implements StackManipulation { public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, typeDescription.getInternalName()); return StackSize.ZERO.toIncreasingSize(); } protected  TypeCasting(TypeDescription typeDescription); static StackManipulation to(TypeDefinition typeDefinition); boolean isValid(); Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext);  }