### Question:
StringGroovyScript implements GroovyScript { @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(script.getBytes()); } StringGroovyScript(String script); @Override InputStream getInputStream();  }### Answer:
@Test public void init() throws Exception { StringGroovyScript script = new StringGroovyScript("print 'Hello, Jenkins!'"); assertEquals("print 'Hello, Jenkins!'", Streams.toString(script.getInputStream())); }