public static boolean studentHasSomeAttendsInGrouping( final Registration registration, final Grouping groupProperties) { for (final Attends attends : groupProperties.getAttendsSet()) { final Registration otherRegistration = attends.getRegistration(); if (registration == otherRegistration) { return true; } } return false; }