newMealStart.getPointAttributes() .removeAttribute(AttributeType.MEAL);
    public void plotPoint(TimePoint newPoint, int workedPoints) {        int timeLineSize = getNumberOfTimePoints();        Attributes insideIntervals = new Attributes();        for (int i = 0; i < timeLineSize; i++) {            TimePoint currentPoint = getTimeLinePosition(i);            if (newPoint.isAtSameTime(currentPoint)) {                for (AttributeType attributeType : newPoint.getPointAttributes().getAttributes()) {                    if (insideIntervals.contains(attributeType)) {                        pointClosesInterval(insideIntervals, attributeType, i);                        currentPoint.getPointAttributes().addAttribute(attributeType);                    } else {                        pointOpensInterval(insideIntervals, attributeType, i);                        // insideIntervals.addAttributes(currentPoint.getIntervalAttributes()                        // .getAttributes());                        currentPoint.getPointAttributes().addAttribute(attributeType);                    }                }                return;            } else if (newPoint.isBefore(currentPoint)) {                addPoint(i, newPoint);                // adds the point in this position and shifts the current point to the next position                // (i+1) se attrib ponto do novo ponto estao em intervalos abertos => intervalo vai-se                // fechar                for (AttributeType attributeType : newPoint.getPointAttributes().getAttributes()) {                    if (insideIntervals.contains(attributeType)) {                        pointClosesInterval(insideIntervals, attributeType, i);                    } else {                        pointOpensInterval(insideIntervals, attributeType, i);                    }                }                return; // get off the for loop            } else {                // is after caso em q o intervalo ja esta' aberto faz o update do atributo no ponto                for (AttributeType attribute : currentPoint.getPointAttributes().getAttributes()) {                    if (insideIntervals.contains(attribute)) {                        newPoint.getIntervalAttributes().removeAttribute(attribute);                        // removes the current point attribute to new point interval attributes                        insideIntervals.removeAttribute(attribute);                    } else {                        if (!newPoint.getIntervalAttributes().contains(AttributeType.JUSTIFICATION)                                && newPoint.getPointAttributes().contains(                                        DomainConstants.WORKED_ATTRIBUTES)                                && attribute.equals(AttributeType.MEAL) && workedPoints % 2 == 0                                && workedPoints != 0) {                            TimePoint mealStart = findIntervalStartPointByAttribute(AttributeType.MEAL);                            TimePoint newMealStart = findStartLunchBreak(null);                            if (!mealStart.getPointAttributes().contains(                                    DomainConstants.WORKED_ATTRIBUTES)                                    && newMealStart != null && newMealStart.isBefore(mealStart)) {                                int newMealIndex = getTimePointIndex(newMealStart);                                if (newMealIndex != -1) {                                    newMealStart.getPointAttributes()                                            .removeAttribute(AttributeType.MEAL);                                    newMealStart.getPointAttributes().addAttribute(AttributeType.MEAL);                                    newMealStart.getIntervalAttributes()                                            .addAttribute(AttributeType.MEAL);                                    addIntervalAttributeToNextPoints(newMealIndex, new Attributes(                                            AttributeType.MEAL));                                }                            }                            TimePoint mealEnd = findIntervalEndPointByAttribute(AttributeType.MEAL);                            if (mealEnd != null) {                                TimePoint pointBeforeMeal = findWorkedPointBefore(newPoint);                                if (!mealEnd.getPointAttributes().contains(                                        DomainConstants.WORKED_ATTRIBUTES)                                        && pointBeforeMeal.getIntervalAttributes().contains(                                                AttributeType.MEAL)) {                                    int oldMealIndex = getTimePointIndex(mealEnd);                                    if (oldMealIndex != -1) {                                        mealEnd.getPointAttributes().removeAttribute(attribute);                                        addIntervalAttributeToNextPoints(oldMealIndex, new Attributes(                                                AttributeType.MEAL));                                    }                                    newPoint.getPointAttributes().addAttribute(attribute);                                    insideIntervals.addAttribute(attribute);                                }                            } else {                                newPoint.getPointAttributes().addAttribute(attribute);                                insideIntervals.addAttribute(attribute);                            }                        } else {                            newPoint.getIntervalAttributes().addAttribute(attribute);                            // adds the current point attribute to new point interval attributes                            insideIntervals.addAttribute(attribute);                        }                    }                }            }        }        TimePoint lastTimelinePoint = getTimeLinePosition(timeLineSize - 1);        // the newpoint is after the last point in the timeline        newPoint.setTime(lastTimelinePoint.getTime());        newPoint.setNextDay(lastTimelinePoint.isNextDay());        addPoint(timeLineSize - 1, newPoint);        // adds the point in this position and shifts the current point to the next position        // (i+1) se attrib ponto do novo ponto estao em intervalos abertos => intervalo vai-se        // fechar        if (insideIntervals.contains(newPoint.getPointAttributes())) {            // inserted point only has 1 attribute            pointClosesInterval(insideIntervals, newPoint, timeLineSize - 1);        } else { // novo intervalo            pointOpensInterval(insideIntervals, newPoint, timeLineSize - 1);        }    }