sampling, java doc