{
double[] delta = { 0d, 0.023d, 0.043d, 0.02d, 0.05d, 0.08d, 0.1d, 0.04d, -0.05d };
long[] transferals = { 1000000, 0, 20000, -40000, 0, 0, 540000, -369704, 0 };
long[] transferals2 = { 1000000, 0, 0, 0, 0, 0, 0, 0, 0 };
Client client = createClient(delta, transferals);
ReportingPeriod.FromXtoY period = new ReportingPeriod.FromXtoY(Dates.date(2012, Calendar.JANUARY, 1), //
Dates.date(2012, Calendar.JANUARY, 9));
ClientIndex index = PerformanceIndex.forClient(client, period, new ArrayList<Exception>());
double[] accumulated = index.getAccumulatedPercentage();
for (int ii = 0; ii < accumulated.length; ii++)
assertThat(accumulated[ii], IsCloseTo.closeTo(delta[ii], PRECISION));
Client anotherClient = createClient(delta, transferals2);
index = PerformanceIndex.forClient(anotherClient, period, new ArrayList<Exception>());
accumulated = index.getAccumulatedPercentage();
for (int ii = 0; ii < accumulated.length; ii++)
assertThat(accumulated[ii], IsCloseTo.closeTo(delta[ii], PRECISION));