@Test public void testExcelSampleAggregatedWeekly() { // first day of week is locale dependent Locale locale = Locale.getDefault(); Locale.setDefault(Locale.GERMAN); try { Client client = createClient(); ReportingPeriod.FromXtoY reportInterval = new ReportingPeriod.FromXtoY( // LocalDate.of(2011, Month.DECEMBER, 31), LocalDate.of(2012, Month.JANUARY, 8)); CurrencyConverter converter = new TestCurrencyConverter(); PerformanceIndex index = PerformanceIndex.forClient(client, converter, reportInterval, new ArrayList<Exception>()); index = Aggregation.aggregate(index, Aggregation.Period.WEEKLY); assertNotNull(index); double[] delta = index.getDeltaPercentage(); assertThat(delta.length, is(2)); assertThat(delta[0], IsCloseTo.closeTo(0.023d, PRECISION)); assertThat(delta[1], IsCloseTo.closeTo(-0.0713587d, PRECISION)); double[] accumulated = index.getAccumulatedPercentage(); assertThat(accumulated[0], IsCloseTo.closeTo(0.023d, PRECISION)); assertThat(accumulated[1], IsCloseTo.closeTo(-0.05d, PRECISION)); } finally { Locale.setDefault(locale); } }