Note that Arrays require their type to be known at compile time, so we construct an anonymous object with reference to function with reified type parameters as a workaround.