class TrainingSetManager {

	public boolean releaseTrainingSet(long id, boolean finished)
	{
		AssignedTrainingSet assignedTrainingSet = getAssignedTrainingSet(id);
		if (assignedTrainingSets.stream().anyMatch(o -> o.getClientID() == id) && !finished
				&& assignedTrainingSet != null)
		{
			trainingSets.add(assignedTrainingSet.getTrainingSet());
		}
		return assignedTrainingSets.remove(assignedTrainingSet);
	}

	  TrainingSetManager();

}