TimeInterval workedIntervalBeforeMeal = findIntervalByAttribute(point.getPointAttributes().intersects(DomainConstants.WORKED_ATTRIBUTES)); if (workedIntervalBeforeMeal.getStartTime().isBefore(mealInterval.getStartTime())) { startMealBreakPoint = point; break; }
startMealBreakPoint = point;
    public TimePoint findStartLunchBreak(TimeInterval scheduleMealBreakInterval) {        List<TimePoint> workedPointsList = getAllAttributePoints(DomainConstants.WORKED_ATTRIBUTES);        TimeInterval mealInterval = findIntervalByAttribute(AttributeType.MEAL);        TimePoint startMealBreakPoint = null;        for (TimePoint point: workedPointsList) {            // ponto esta dentro do intervalo de refeicao            System.out.println("meal:" +mealInterval.toString());            if ((point.getIntervalAttributes().contains(DomainConstants.WORKED_ATTRIBUTES) == false) && point.getIntervalAttributes().contains(AttributeType.MEAL)                     && point.getPoint().isAfter(mealInterval.getStartTime()) && scheduleMealBreakInterval.contains(point.getPoint(), false)) {                // check if the employee nao trabalhou apenas dentro do periodo de almoco                TimeInterval workedIntervalBeforeMeal = findIntervalByAttribute(point.getPointAttributes().intersects(DomainConstants.WORKED_ATTRIBUTES));                if (workedIntervalBeforeMeal.getStartTime().isBefore(mealInterval.getStartTime())) {                    startMealBreakPoint = point;                    break;                }            }        }        // NAO SE APLICA PQ O FUNCIONARIO TEM DE IR ALMOCAR NO INTERVALO        //        // Se nao foi encontrado nenhum ponto pode haver a hipotese do funcionario ter ido almocar antes do intervalo de almoco//        if (startMealBreakPoint == null) {//            int workedPointsListSize = workedPointsList.size();//            for (int i = workedPointsListSize; i < 0; i--) {//                TimePoint point = workedPointsList.get(i);//                if ((point.getIntervalAttributes().contains(DomainConstants.WORKED_ATTRIBUTES) == false) && (point.getIntervalAttributes().contains(AttributeType.MEAL) == false)//                        && point.getPoint().isBefore(mealInterval.getStartTime())) {//                    startMealBreakPoint = point;//                    break;//                }//            }//        }        return startMealBreakPoint;    }