Validation of Capillarity Theory at the Nanometer Scale by Atomistic Computer Simulations of Water Droplets and Bridges in Contact with Hydrophobic and Hydrophilic Surfaces