Runaway collisions in young star clusters – I. Methods and tests