### Question:
RandomSplit extends AbstractFilterSplit { public RandomSplit(Dataset dataset, double trainPercentage, Random random) { super(dataset); if (trainPercentage <= 0 || trainPercentage > 1) { throw new IllegalArgumentException("trainPercentage must be in range (0,1]"); } Objects.requireNonNull(random, "random must not be null"); int numInstances = CollectionHelper.count(dataset.iterator()); List<Integer> indices = new ArrayList<>(); for (int i = 0; i < numInstances; i++) { indices.add(i); } Collections.shuffle(indices, random); this.indices = Collections.unmodifiableList(indices); this.splitIndex = (int) Math.round(trainPercentage * numInstances); LOGGER.debug("numInstances = {}", numInstances); LOGGER.debug("splitIndex = {}", splitIndex); } RandomSplit(Dataset dataset, double trainPercentage, Random random);  RandomSplit(Dataset dataset, double trainPercentage);   }### Answer:
@Test public void testRandomTestSplit() { Dataset data = new RandomDataset(100); RandomSplit split = new RandomSplit(data, 0.75); assertEquals(75, split.getTrain().size()); assertEquals(25, split.getTest().size()); }