if (!(identification instanceof Login)) { continue outter; }  Login login = (Login) identification;  if (!login.hasUsername(username)) { continue outter;
if (identification instanceof Login) { Login login = (Login) identification; if (!login.hasUsername(username)) { continue outter; }
    private static List<ProjectAccess> getAllByPersonUsernameAndCoordinatorOrCostCenterOrProject(            String username, Integer coordinatorCode, Integer costCenter, Integer projectCode,            boolean all) {        List<ProjectAccess> result = new ArrayList<ProjectAccess>();        Date currentDate = Calendar.getInstance().getTime();        outter: for (ProjectAccess projectAccess : RootDomainObject.getInstance().getProjectAccesss()) {            if (projectCode != null && !projectCode.equals(projectAccess.getKeyProject())) {                continue;            }            if (coordinatorCode != null                    && !coordinatorCode.equals(projectAccess.getKeyProjectCoordinator())) {                continue;            }            if (costCenter != null) {                if (!costCenter.equals(projectAccess.getKeyProjectCoordinator())) {                    continue;                }                if (!projectAccess.getCostCenter()) {                    continue;                }            } else {                if (coordinatorCode == null && projectCode == null && projectAccess.getCostCenter()) {                    continue;                }            }            if (projectAccess.getEnd().before(currentDate)) {                continue;            }            // skip projects accesses that begin in the future            if (!all && projectAccess.getBegin().after(currentDate)) {                continue;            }            for (Identification identification : projectAccess.getPerson().getUser()                    .getIdentifications()) {                if (!(identification instanceof Login)) {                    continue outter;                }                Login login = (Login) identification;                if (!login.hasUsername(username)) {                    continue outter;                }            }            result.add(projectAccess);        }        return result;    }