cohort.setAttributes(ParamUtils.defaultObject(cohort.getAttributes(), HashMap::new)); cohort.setRelease(studyManager.getCurrentRelease(study, userId)); cohort.setStats(ParamUtils.defaultObject(cohort.getStats(), Collections::emptyMap)); cohort.setStatus(ParamUtils.defaultObject(cohort.getStatus(), Cohort.CohortStatus::new)); cohort.setSamples(ParamUtils.defaultObject(cohort.getSamples(), Collections::emptyList));