@Test
public void testEarningsSumOverYear() {

    Statistics resource = new Statistics();
    UkelonnService ukelonn = mock(UkelonnService.class);
    when(ukelonn.earningsSumOverYear(eq("jad"))).thenReturn(Arrays.asList(new SumYear(1250.0, 2016)));
    resource.ukelonn = ukelonn;
    String username = "jad";
    List<SumYear> earningsSumOverYear = resource.earningsSumOverYear(username);
    assertThat(earningsSumOverYear).isNotEmpty();
    assertEquals(2016, earningsSumOverYear.get(0).getYear());
}