@Override
    public Thread newThread(Runnable r) {
        String threadName = name + id.getAndIncrement();
        Thread thread = new Thread(r, threadName);
        thread.setDaemon(true);
        return thread;
    }
@Test
    void test() {
        NameThreadFactory threadFactory = new NameThreadFactory("test");
        Thread t1 = threadFactory.newThread(() -> {
        
        });
        Thread t2 = threadFactory.newThread(() -> {
        
        });
        
        assertEquals("test.0", t1.getName());
        assertEquals("test.1", t2.getName());
    }