class ProjectDependencyServiceImpl implements ProjectDependencyService {

	@Override
	public Boolean devDependencyExists(Integer projectId, Integer componentRepoId) {
		List<ComponentRepoVersion> componentRepoVersions = componentRepoVersionDao.findAllByComponentRepoId(componentRepoId);
		if(componentRepoVersions.isEmpty()) {
			return false;
		}
		List<ProjectDependency> devDependencies = projectDependencyDao.findAllByProjectIdAndProfileId(projectId, null);
		if(devDependencies.isEmpty()) {
			return false;
		}
		
		return componentRepoVersions.stream()
				.anyMatch(version -> devDependencies.stream()
						.anyMatch(dependence -> version.getId().equals(dependence.getComponentRepoVersionId())));
	}

}