public Duration calculateDurationAllIntervalsByAttributesFromTime(TimeOfDay timeOfDay, Attributes attributes) {
public Duration calculateDurationAllIntervalsByAttributesFromTime(TimePoint timePoint, Attributes attributes) {
    public Duration calculateDurationAllIntervalsByAttributesFromTime(TimeOfDay timeOfDay, Attributes attributes) {        Duration totalDuration = new Duration(0);        for (AttributeType attribute: attributes.getAttributes()) {            TimeInterval interval = findIntervalByAttribute(attribute);            if (interval != null) {                if (interval.getStartTime().isAfter(timeOfDay) || interval.getStartTime().equals(timeOfDay)) {                    totalDuration = totalDuration.plus(interval.getDuration());                }            } else {                break;            }                   }        return totalDuration;    }