ExperimentSettingsUtil { public static ExperimentSettings toExperimentSettings( double confidenceLevel, Map<String, Double> segmentsExperienceKeySplitMap, SegmentsExperiment segmentsExperiment) { ExperimentSettings experimentSettings = new ExperimentSettings(); experimentSettings.setConfidenceLevel(confidenceLevel); List<DXPVariantSettings> dxpVariantsSettings = new ArrayList<>(); segmentsExperienceKeySplitMap.forEach( (segmentsExperienceKey, split) -> dxpVariantsSettings.add( DXPVariantSettingsUtil.toDXPVariantSettings( segmentsExperiment.getSegmentsExperienceKey(), segmentsExperienceKey, split))); experimentSettings.setDXPVariantsSettings(dxpVariantsSettings); return experimentSettings; }  static ExperimentSettings toExperimentSettings(
		double confidenceLevel,
		Map<String, Double> segmentsExperienceKeySplitMap,
		SegmentsExperiment segmentsExperiment);  }
@Test public void testToExperimentSettings() { double confidenceLevel = RandomTestUtil.randomDouble(); Map<String, Double> segmentsExperienceKeySplitMap = HashMapBuilder.put( RandomTestUtil.randomString(), RandomTestUtil.randomDouble() ).build(); SegmentsExperiment segmentsExperiment = Mockito.mock( SegmentsExperiment.class); Mockito.doReturn( RandomTestUtil.randomString() ).when( segmentsExperiment ).getSegmentsExperimentKey(); ExperimentSettings experimentSettings = ExperimentSettingsUtil.toExperimentSettings( confidenceLevel, segmentsExperienceKeySplitMap, segmentsExperiment); Assert.assertEquals( confidenceLevel, experimentSettings.getConfidenceLevel(), 0.001); List<DXPVariantSettings> dxpVariantsSettings = experimentSettings.getDXPVariantsSettings(); Assert.assertEquals( dxpVariantsSettings.toString(), 1, dxpVariantsSettings.size()); Map<String, DXPVariantSettings> dxpVariantsSettingsMap = experimentSettings.getDXPVariantsSettingsMap(); Assert.assertEquals( dxpVariantsSettingsMap.toString(), 1, dxpVariantsSettingsMap.size()); }