@Test
public void findProjectPerformanceByStartDateAndEndDateTest() throws Exception {

	// given
	Date snapshotDate = new Date(System.currentTimeMillis());
	Project p = new ProjectBuilder().gitHubProjectId(1).organizationName(ORGANIZATION1).snapshotDate(snapshotDate)
			.starsCount(4).commitsCount(6).contributorsCount(2).score(20).forksCount(0).create();
	Project p1 = new ProjectBuilder().gitHubProjectId(1).organizationName(ORGANIZATION1).days(1).starsCount(1)
			.commitsCount(2).contributorsCount(1).score(20).forksCount(0).create();
	when(projectRepository.findProjects(ORGANIZATION1, snapshotDate, empty(), empty()))
			.thenReturn(singletonList(p));
	when(projectRepository.findProjects(ORGANIZATION1, p1.getSnapshotDate(), empty(), empty()))
			.thenReturn(singletonList(p1));
	// when
	List<Project> projectList = (List<Project>) projectService.findProjects(ORGANIZATION1, empty(), empty(),
			Optional.ofNullable(p1.getSnapshotDate()), Optional.ofNullable(p.getSnapshotDate()), empty(), empty(),
			empty());
	// then
	p.setStarsCount(p.getStarsCount() - p1.getStarsCount());
	p.setCommitsCount(p.getCommitsCount() - p1.getCommitsCount());
	p.setForksCount(p.getForksCount() - p1.getForksCount());
	p.setContributorsCount(p.getContributorsCount() - p1.getContributorsCount());
	p.setScore(p.getScore() - p1.getScore());
	assertThat(projectList, hasSize(1));
	assertThat(projectList.get(0), equalTo(p));
}