AbstractDuplicator { protected Random getRandom() { if (rnd == null) { rnd = new RandomWrapper(); distribution.reseedRandomGenerator(rnd.getSeed()); if (LOG.isInfoEnabled()) { LOG.info( "A seed is generated for Random generator. If a fixed seed is needed, set it in the advanced parameters of the tDuplicateRow component"); } } return rnd; } AbstractDuplicator(double expectation, double duplicatesPercentage, String distributionName);  AbstractDuplicator(double expectation, double duplicatesPercentage, String distributionName,
            long distributionSeed); List<O> process(I v); void setSeed(long seed);  }
@Test public void testDistroWithoutSeed() { for (int i = 0; i < distroNames.length; i++) { AbstractDuplicator<row1Struct, row2Struct> duplicator = new AbstractDuplicator<row1Struct, row2Struct>( grp_size_expectation, duplicate_percentage, distroNames[i]) { @Override protected row2Struct generateOutput(row1Struct v, boolean isOriginal) { row2Struct tmpStruct = new row2Struct(); tmpStruct.id = v.id; tmpStruct.city = v.city; if (isOriginal) { tmpStruct.ORIGINAL_MARK = false; } else { tmpStruct.ORIGINAL_MARK = true; } return tmpStruct; } }; int[] result = getCountResult(duplicator); Random random = duplicator.getRandom(); long seed = ((RandomWrapper) random).getSeed(); AbstractDuplicator<row1Struct, row2Struct> duplicator2 = new AbstractDuplicator<row1Struct, row2Struct>( grp_size_expectation, duplicate_percentage, distroNames[i], seed) { @Override protected row2Struct generateOutput(row1Struct v, boolean isOriginal) { row2Struct tmpStruct = new row2Struct(); tmpStruct.id = v.id; tmpStruct.city = v.city; if (isOriginal) { tmpStruct.ORIGINAL_MARK = false; } else { tmpStruct.ORIGINAL_MARK = true; } return tmpStruct; } }; int[] result2 = getCountResult(duplicator2); assertEquals(result[0], result2[0]); assertEquals(result[1], result2[1]); assertEquals(result[2], result2[2]); } }