### Question:
GroovyDataHandlerFactory implements DataHandlerFactory { @Override public DataHandler create(final InputStream src) { try { final String groovyScript = IOUtils.toString(src, StandardCharsets.UTF_8); final DataHandlerProvider dataHandlerProvider = groovyDataHandlerCompiler.compile(groovyScript); return dataHandlerProvider.getDataHandler(); } catch (final IOException e) { throw new GroovyDataHandlerFactoryException(e); } } GroovyDataHandlerFactory(final GroovyDataHandlerCompiler groovyDataHandlerCompiler);  GroovyDataHandlerFactory(); @Override DataHandler create(final InputStream src);  }### Answer:
@Test public void testCreate() { final InputStream inputStream = ResourceUtils.getInputStream(TEST_GROOVY_DATA_HANDLER); final DataHandler dataHandler = groovyDataHandlerFactory.create(inputStream); final byte[] request = new byte[]{0x02, 'p', 'i', 'n', 'g', 0x03}; final Optional<byte[]> response = dataHandler.handle(request); assertThat(response, is(optionalWithValue(equalTo(new byte[]{0x02, 'p', 'o', 'n', 'g', 0x03})))); }