IdGenerator { public static <T> Id<T> getId(Class<T> classForId) { return Id.create(getNextId(classForId)); } private  IdGenerator(); static Id<T> getId(Class<T> classForId); static Id<T> getCachedId(Class<T> classForId); static AtomicLong getRawIdGenerator(Class<?> classForId); static void initialiseIdCounter(Class<?> classForId, long lastId); static void clear();  }
@Test public void getIdReturnsNewId() { Id<A> idA = IdGenerator.getId(A.class); Id<B> idB = IdGenerator.getId(B.class); Assertions.assertNotSame(idA, idB); Assertions.assertSame(idA.id, idB.id); }