### Question:
ReplaceString extends BaseTransform<ReplaceStringMeta, ReplaceStringData> implements ITransform<ReplaceStringMeta, ReplaceStringData> { public boolean init() { if ( super.init() ) { return true; } return false; } ReplaceString( TransformMeta transformMeta, ReplaceStringMeta meta, ReplaceStringData data, int copyNr, PipelineMeta pipelineMeta,
                        Pipeline pipeline ); static String replaceString( String originalString, Pattern pattern, String replaceByString ); boolean processRow(); boolean init(); void dispose();  }### Answer:
@Test public void testSynchronizeDifferentFieldsArraysLengths() throws Exception { ReplaceStringData data = new ReplaceStringData(); ReplaceStringMeta meta = new ReplaceStringMeta(); ReplaceString replaceString = new ReplaceString( transformMockHelper.transformMeta, meta, data, 0, transformMockHelper.pipelineMeta, transformMockHelper.pipeline ); replaceString.init(); meta.setFieldInStream( new String[] { "input1", "input2" } ); meta.setFieldOutStream( new String[] { "out" } ); meta.setUseRegEx( new int[] { 1 } ); meta.setCaseSensitive( new int[] { 0 } ); meta.setWholeWord( new int[] { 1 } ); meta.setReplaceString( new String[] { "string" } ); meta.setReplaceByString( new String[] { "string" } ); meta.setEmptyString( new boolean[] { true } ); meta.setFieldReplaceByString( new String[] { "string" } ); meta.afterInjectionSynchronization(); Assert.assertEquals( meta.getFieldInStream().length, meta.getFieldOutStream().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getFieldOutStream()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getUseRegEx().length ); Assert.assertEquals( 0, meta.getUseRegEx()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getCaseSensitive().length ); Assert.assertEquals( 0, meta.getCaseSensitive()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getWholeWord().length ); Assert.assertEquals( 0, meta.getWholeWord()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getReplaceString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getReplaceString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getReplaceByString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getReplaceByString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.isSetEmptyString().length ); Assert.assertEquals( false, meta.isSetEmptyString()[ 1 ] ); Assert.assertEquals( meta.getFieldInStream().length, meta.getFieldReplaceByString().length ); Assert.assertEquals( StringUtils.EMPTY, meta.getFieldReplaceByString()[ 1 ] ); }