code: protected List<Intervalable> checkForOverlaps(Intervalable interval, Direction direction)
      {
  
          List<Intervalable> overlaps = new ArrayList<Intervalable>();
          for (Intervalable currentInterval : this.intervals)
          {
              switch (direction)
              {
                  case LEFT:
                      if (currentInterval.getStart() <= interval.getEnd())
                      {
                          overlaps.add(currentInterval);
                      }
                      break;
                  case RIGHT:
                      if (currentInterval.getEnd() >= interval.getStart())
                      {
                          overlaps.add(currentInterval);
                      }
                      break;
              }
          }
          return overlaps;
      }
docs: 寻找重叠
  @param interval 一个区间，与该区间重叠
  @param direction 方向，表明重叠区间在interval的左边还是右边
  @return