Those are air chambers meant to reduce watter hammer, but they are ineffective. In no time at all they are filled with water were and undersized to begin with, sort of an oldtime plumbing superstition. They don't do any good but they don't do any harm. I don't know what project is that caused you to open the wall, but it makes things easier to leave them in, leave them in. If it easier if you cut them out, cut them out.