@Test public void exceptionIsThrown_whenDescriptorOfLoopHeaderIsOfWrongType() { final IExecutableRowDescriptor<?> descriptor = mock(IExecutableRowDescriptor.class); final ExecutableWithDescriptor loopHeader = mock(ExecutableWithDescriptor.class); when(loopHeader.getDescriptor()).thenReturn((IExecutableRowDescriptor) descriptor); final ForLoop forLoop = new ForLoop(loopHeader, newArrayList()); assertThatExceptionOfType(ClassCastException.class).isThrownBy(forLoop::getDescriptor); }
ForLoopDeclarationRowDescriptor<?> getDescriptor() { return (ForLoopDeclarationRowDescriptor<?>) loopHeader.getDescriptor(); }
ForLoop { ForLoopDeclarationRowDescriptor<?> getDescriptor() { return (ForLoopDeclarationRowDescriptor<?>) loopHeader.getDescriptor(); } }
ForLoop { ForLoopDeclarationRowDescriptor<?> getDescriptor() { return (ForLoopDeclarationRowDescriptor<?>) loopHeader.getDescriptor(); } ForLoop(final ExecutableWithDescriptor loopHeader, final List<ExecutableWithDescriptor> executables); }
ForLoop { ForLoopDeclarationRowDescriptor<?> getDescriptor() { return (ForLoopDeclarationRowDescriptor<?>) loopHeader.getDescriptor(); } ForLoop(final ExecutableWithDescriptor loopHeader, final List<ExecutableWithDescriptor> executables);  }
ForLoop { ForLoopDeclarationRowDescriptor<?> getDescriptor() { return (ForLoopDeclarationRowDescriptor<?>) loopHeader.getDescriptor(); } ForLoop(final ExecutableWithDescriptor loopHeader, final List<ExecutableWithDescriptor> executables);   }