@@ -0,0 +1,1159 @@
+package com.github.rnowling.bps.datagenerator.algorithms.samplers;%0A%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.matchers.JUnitMatchers.*;%0A%0Aimport java.util.Map;%0A%0Aimport org.junit.Test;%0A%0Aimport com.github.rnowling.bps.datagenerator.SeedFactory;%0Aimport com.google.common.collect.ImmutableMap;%0A%0Apublic class TestRouletteWheelSampler%0A%7B%0A%0A%09@Test%0A%09public void testSample()%0A%09%7B%0A%09%09Map%3CString, Double%3E dataPoints = ImmutableMap.of(%0A%09%09%09%09%22a%22, 0.25,%0A%09%09%09%09%22b%22, 0.25,%0A%09%09%09%09%22c%22, 0.25,%0A%09%09%09%09%22d%22, 0.25%0A%09%09%09%09);%0A%09%09%0A%09%09SeedFactory seedFactory = new SeedFactory(1234);%0A%09%09%0A%09%09Sampler%3CString%3E sampler = new RouletteWheelSampler%3CString%3E(dataPoints, seedFactory);%0A%09%09%0A%09%09String result = sampler.sample();%0A%09%09%0A%09%09assertThat(dataPoints.keySet(), hasItem(result));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testSampleUnnormalized()%0A%09%7B%0A%09%09Map%3CString, Double%3E dataPoints = ImmutableMap.of(%0A%09%09%09%09%22a%22, 1.0,%0A%09%09%09%09%22b%22, 1.0,%0A%09%09%09%09%22c%22, 1.0,%0A%09%09%09%09%22d%22, 1.0%0A%09%09%09%09);%0A%09%09%0A%09%09SeedFactory seedFactory = new SeedFactory(1234);%0A%09%09%0A%09%09Sampler%3CString%3E sampler = new RouletteWheelSampler%3CString%3E(dataPoints, seedFactory);%0A%09%09%0A%09%09String result = sampler.sample();%0A%09%09%0A%09%09assertThat(dataPoints.keySet(), hasItem(result));%0A%09%7D%0A%0A%7D%0A

Add unit test for RouletteWheelSampler