Source: http://tdinfo.phelma.grenoble-inp.fr/2Apoo/Ex2A201505Java.pdf