[Tests] Move function for getting a pre-filled array to dune-common