code: private Collection<CollisionFormula> checkConstraints(TileCollision tile, int h, int v)
      {
          final Tile top = map.getTile(h, v + 1);
          final Tile bottom = map.getTile(h, v - 1);
          final Tile left = map.getTile(h - 1, v);
          final Tile right = map.getTile(h + 1, v);
  
          final Collection<CollisionFormula> toRemove = new ArrayList<>();
          for (final CollisionFormula formula : tile.getCollisionFormulas())
          {
              final CollisionConstraint constraint = formula.getConstraint();
              if (checkConstraint(constraint.getConstraints(Orientation.NORTH), top)
                  || checkConstraint(constraint.getConstraints(Orientation.SOUTH), bottom)
                  || checkConstraint(constraint.getConstraints(Orientation.WEST), left)
                  || checkConstraint(constraint.getConstraints(Orientation.EAST), right))
              {
                  toRemove.add(formula);
              }
          }
          return toRemove;
      }
docs: Check the tile constraints and get the removable formulas.
  
  @param tile The current tile to check.
  @param h The horizontal location.
  @param v The vertical location.
  @return The formula to remove.