[java-api] convenience method to get the elements of a DataSet