package me.haosdent.cgroup.util;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.Assert.*;

public class ThreadsTest {

  private static final Logger LOG = LoggerFactory.getLogger(ThreadsTest.class);

  @Test
  public void testGetThreadId() {
    Thread thread = new Thread() {
      @Override
      public void run() {
        int id = Threads.getThreadId();
        LOG.info("Thread Id: " + id);
        assertTrue(id != 0);
      }
    };
    thread.start();
    try {
      thread.join();
    } catch (InterruptedException e) {
      LOG.error("Thread Error.", e);
      assertTrue(false);
    }
  }

  public static void main(String[] args) {
    Thread thread = new Thread() {
      @Override
      public void run() {
        int id = Threads.getThreadId();
        LOG.info("Thread Id: " + id);
        assertTrue(id != 0);
      }
    };
    thread.start();
    try {
      thread.join();
    } catch (InterruptedException e) {
      LOG.error("Thread Error.", e);
      assertTrue(false);
    }
  }
}

@@ -658,412 +658,7 @@
 %0A  %7D
-%0A%0A  public static void main(String%5B%5D args) %7B%0A    Thread thread = new Thread() %7B%0A      @Override%0A      public void run() %7B%0A        int id = Threads.getThreadId();%0A        LOG.info(%22Thread Id: %22 + id);%0A        assertTrue(id != 0);%0A      %7D%0A    %7D;%0A    thread.start();%0A    try %7B%0A      thread.join();%0A    %7D catch (InterruptedException e) %7B%0A      LOG.error(%22Thread Error.%22, e);%0A      assertTrue(false);%0A    %7D%0A  %7D
 %0A%7D%0A

Remove main method in ThreadsTest