Cut the PVC to the length needed with a hacksaw.
Rub primer onto one end of the pipe with the brush included with the primer. Rub cement over the primer. Press the PVC cap onto the pipe. Twist the cap a quarter turn in either direction to fully seat it onto the pipe.
Apply primer and cement to the other end of the pipe. Attached the threaded male adapter to the pipe. Twist the adapter to fully seat it.
Cut cork material into circles with a utility knife to fit into the screw-on cap. Add several layers until the cork material is just past the top threads inside the cap.
Screw the cap into place. The cork material operates as a seal if sufficient layers were made to impact the top of the PVC pipe when threading on the cap. Add more layers of cork if the cork does not touch the tip of the pipe with the cap fully tightened. Removing the cap and looking at the cork will reveal indentations in the cork if the cork and pipe were in contact.