Well, sir considering your in the Left coast of the country where they reward guys in stolen cars and put the cops in Jail I wouldn’t even guess how lax your plumbing codes are with folks like Boxer and Diane ugly face Feinstein around.
Now speaking from a civilized point of view it is not very healthy to have any potable water supply dead ended 24″ or more
Reason being the stagnant water in this pipe can be drawn back into the domestic supply by cavitation and thus sicken everyone in the building.
Right job IMHO would be to bottle this stagnant water and give it to Dianne and Ted Drive em one way Kennedy and let him drive her over a bridge
BUT in your case just cap the dead line as close as possible to where it starts not ends.