def METHOD_NAME(test,tmax=40., restart=False, keep_unsynchronized=1, interval=None, safe_mode=True, integrator="ias15",G=1., testparticle=0,simulationarchive_version=3):
    if restart:
        if keep_unsynchronized==1:
            sim = rebound.Simulation("test.bin")
        else:
            sa = rebound.SimulationArchive("test.bin")
            sim = sa.getSimulation(sa.tmax,keep_unsynchronized=0)
    else:
        sim = rebound.Simulation()
        sim.G = G
        sim.add(m=1)
        sim.add(m=1e-3,a=1,e=0.1,omega=0.1,M=0.1,inc=0.1,Omega=0.1)
        sim.add(m=1e-3,a=-2,e=1.1,omega=0.1,M=0.1,inc=0.1,Omega=0.1)
        sim.integrator = integrator
        sim.dt = 0.1313
        if simulationarchive_version==1:
            sim.simulationarchive_version = 1
        if safe_mode==False:
            sim.ri_whfast.safe_mode = 1
            sim.ri_mercurius.safe_mode = 1
        if testparticle>0:
            if testparticle==1:
                sim.testparticle_type=0
            if testparticle==2:
                sim.testparticle_type=1
            sim.add(m=1e-4,a=1.2,e=0.04,omega=0.21,M=1.41,inc=0.21,Omega=1.1)
            sim.N_active = sim.N-1 # one test particle
        if interval:
            sim.automateSimulationArchive("test.bin", interval, deletefile=True)
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always")
        sim.integrate(tmax,exact_finish_time=0)
        if testparticle==1:
            test.assertEqual(1,len(w))
        else:
            test.assertEqual(0,len(w))
    return sim