if (workedStartPoint != null) {
if (workedStartPoint != null && workedEndPoint != null) {
    public TimeInterval calculateBreakPeriod() {        TimePoint mealStart = findIntervalStartPointByAttribute(AttributeType.MEAL);        System.out.println("mealStart " + mealStart);        TimePoint mealEnd = findIntervalEndPointByAttribute(AttributeType.MEAL);        System.out.println("mealEnd " + mealEnd);                if (mealStart.getIntervalAttributes().contains(DomainConstants.WORKED_ATTRIBUTES)) { // meal esta' dentro de um periodo de trabalho            // TODO pode haver varios worked dentro de meal...            AttributeType workedAttribute = mealStart.getIntervalAttributes().intersects(DomainConstants.WORKED_ATTRIBUTES); // saber qual o atributo de worked            // encontrar o ponto dentro de meal q termina o periodo de trabalho            TimePoint workedEndPoint = findIntervalEndPointBetweenPointsByAttribute(mealStart, mealEnd, workedAttribute);            System.out.println("workedEndPoint " + workedEndPoint);            TimePoint workedStartPoint = findWorkedStartPointBetweenPoints(mealStart, mealEnd); // ver se nao houve marcacao antes do final da refeicao            System.out.println("workedStartPoint " + workedStartPoint);            if (workedStartPoint != null) {                System.out.println("start e' null");                return (new TimeInterval(workedEndPoint.getPoint(), workedStartPoint.getPoint()));            } else if (workedEndPoint != null) {                System.out.println("end e' null");                return (new TimeInterval(workedEndPoint.getPoint(), mealEnd.getPoint()));            }        } else { // mealStart nao esta' dentro dum worked procurar inicio de periodo de trabalho            System.out.println("mealstart nao ta dentro de worked -> entrada dentro do int de refeicao");            TimePoint workedStartPoint = findWorkedStartPointBetweenPoints(mealStart, mealEnd);            System.out.println("workedStartPoint " + workedStartPoint);            // encontrar ponto a partir de workStartPoint            AttributeType workedAttribute = workedStartPoint.getPointAttributes().intersects(DomainConstants.WORKED_ATTRIBUTES); // saber qual o atributo de worked            TimePoint workedEndPoint =  findIntervalEndPointBetweenPointsByAttribute(workedStartPoint, mealEnd, workedAttribute);             System.out.println("workedEndPoint " + workedEndPoint);            // caso em q trabalhou dentro da meal e nao almocou            if (workedStartPoint != null) {                if (workedEndPoint != null) { // saiu antes do final do periodo de almoco entao foi almocar...                    return (new TimeInterval(workedEndPoint.getPoint(), mealEnd.getPoint()));                } else {                    return (new TimeInterval(mealStart.getPoint(), workedStartPoint.getPoint()));                }            } else {                if (workedEndPoint != null) {                    return (new TimeInterval(workedEndPoint.getPoint(), mealEnd.getPoint()));                } else {                    return (new TimeInterval(mealStart.getPoint(), mealEnd.getPoint()));                }            }        }        return null;    }    