### Question:
ShellConverter extends SingleTypedConverter<Shell> { @Override public boolean convert(ConverterRequest request, ConverterResult result, Object target) { Shell shell = (Shell) target; ModelASTStage stage = new ModelASTStage( this ); int stageNumber = request.getAndIncrement( SHELL_NUMBER_KEY ); stage.setName( "Shell script " + stageNumber ); ModelASTBranch branch = new ModelASTBranch( this ); stage.setBranches( Arrays.asList( branch ) ); ModelASTStep step = new ModelASTStep( this ); step.setName( "sh" ); ModelASTSingleArgument singleArgument = new ModelASTSingleArgument( this ); singleArgument.setValue( ModelASTValue.fromConstant( shell.getCommand(), this ) ); step.setArgs( singleArgument ); ModelASTUtils.wrapBranch(result, step, branch); ModelASTUtils.addStage(result.getModelASTPipelineDef(), stage); return true; }  @Override boolean convert(ConverterRequest request, ConverterResult result, Object target); static final String SHELL_NUMBER_KEY; }### Answer:
@Test public void simpletest() throws Exception { ExtensionList<BaseConverter> allConverters = SingleTypedConverter.all(); ShellConverter converter = j.jenkins.getExtensionList( ShellConverter.class ).get( 0 ); Shell shell = new Shell( "ls -lrt" ); ConverterResult result = new ConverterResult(); assertTrue(converter.convert( new ConverterRequest(), result, shell )); List<ModelASTStage> stages = result.getModelASTPipelineDef().getStages().getStages(); assertNotNull( stages ); String stageGroovy = stages.get(0).toGroovy(); assertThat( stageGroovy, CoreMatchers.containsString( "sh 'ls -lrt'" ) ); }