### Question:
VoidAwareAssigner implements Assigner { public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Typing typing) { if (source.represents(void.class) && target.represents(void.class)) { return StackManipulation.Trivial.INSTANCE; } else if (source.represents(void.class) ) { return typing.isDynamic() ? DefaultValue.of(target) : StackManipulation.Illegal.INSTANCE; } else if ( target.represents(void.class)) { return Removal.of(source); } else { return chained.assign(source, target, typing); } } VoidAwareAssigner(Assigner chained); StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Typing typing);  }### Answer:
@Test public void testAssignVoidToVoid() throws Exception { when(sourceTypeDescription.represents(void.class)).thenReturn(true); when(targetTypeDescription.represents(void.class)).thenReturn(true); Assigner voidAwareAssigner = new VoidAwareAssigner(chainedAssigner); StackManipulation stackManipulation = voidAwareAssigner.assign(sourceTypeDescription, targetTypeDescription, Assigner.Typing.STATIC); assertThat(stackManipulation.isValid(), is(true)); StackManipulation.Size size = stackManipulation.apply(methodVisitor, implementationContext); assertThat(size.getSizeImpact(), is(0)); assertThat(size.getMaximalSize(), is(0)); verifyZeroInteractions(chainedAssigner); }
@Test public void testAssignNonVoidToNonVoid() throws Exception { Assigner voidAwareAssigner = new VoidAwareAssigner(chainedAssigner); StackManipulation chainedStackManipulation = mock(StackManipulation.class); when(chainedAssigner.assign(sourceTypeDescription, targetTypeDescription, Assigner.Typing.STATIC)).thenReturn(chainedStackManipulation); StackManipulation stackManipulation = voidAwareAssigner.assign(sourceTypeDescription, targetTypeDescription, Assigner.Typing.STATIC); assertThat(stackManipulation, is(chainedStackManipulation)); verify(chainedAssigner).assign(sourceTypeDescription, targetTypeDescription, Assigner.Typing.STATIC); verifyNoMoreInteractions(chainedAssigner); }