If you dig one block down into the ground with surroundings and place a fence gate over it, a player that stands in that hole will start to swim if the gate is closed. Please refer to the pictures included.
Environment
OS: Windows 10 1809
Java: 1.8.0_211-b12
Duplicate of MC-147612