const rand = singleton(Math.random);
const first = rand.getInstance();
const second = rand.getInstance(); // first === second
const str = singleton(() => "a");
const first = rand.getInstance(); // "a"
str.setInstance("b");
const second = rand.getInstance(); // "b", first !== second