code: public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull final Territory territory) {
          checkDefined("point", point);
          if (territory != Territory.AAA) {
              final int territoryNumber = territory.getNumber();
              if (territory.getParentTerritory() != null) {
                  // There is a parent! check its borders as well...
                  if (isNearMultipleBorders(point, territory.getParentTerritory())) {
                      return true;
                  }
              }
              int nrFound = 0;
              final int fromTerritoryRecord = DATA_MODEL.getDataFirstRecord(territoryNumber);
              final int uptoTerritoryRecord = DATA_MODEL.getDataLastRecord(territoryNumber);
              for (int territoryRecord = uptoTerritoryRecord; territoryRecord >= fromTerritoryRecord; territoryRecord--) {
                  if (!Data.isRestricted(territoryRecord)) {
                      final Boundary boundary = Boundary.createBoundaryForTerritoryRecord(territoryRecord);
                      final int xdiv8 = Common.xDivider(boundary.getLatMicroDegMin(), boundary.getLatMicroDegMax()) / 4;
                      if (boundary.extendBoundary(60, xdiv8).containsPoint(point)) {
                          if (!boundary.extendBoundary(-60, -xdiv8).containsPoint(point)) {
                              nrFound++;
                              if (nrFound > 1) {
                                  return true;
                              }
                          }
                      }
                  }
              }
          }
          return false;
      }
docs: Is coordinate near multiple territory borders?
  
  @param point     Latitude/Longitude in degrees.
  @param territory Territory.
  @return true Iff the coordinate is near more than one territory border (and thus encode(decode(M)) may not produce M).