ModuleUtils { public static ModuleInfo getModuleByClass(Class type) { return classModuleInfoRepository.computeIfAbsent(type, ModuleUtils::parse); } private  ModuleUtils(); static ModuleInfo getModuleByClass(Class type); static String getClassPath(Class type); static String getClassPath(String path, String packages); static ModuleInfo getModule(String id); static void register(ModuleInfo moduleInfo);  }
@Test public void test() { ModuleUtils.ModuleInfo moduleInfo = ModuleUtils.getModuleByClass(ModuleUtilsTest.class); Assert.assertNotNull(moduleInfo); Assert.assertFalse(moduleInfo.isNone()); Assert.assertEquals(moduleInfo.getArtifactId(),"hsweb-commons-utils"); System.out.println(moduleInfo.getGitLocation()); System.out.println(moduleInfo.getGitClassLocation(Maps.class,10,12)); ModuleUtils.ModuleInfo noneInfo = ModuleUtils.getModuleByClass(Logger.class); Assert.assertNotNull(noneInfo); Assert.assertTrue(noneInfo.isNone()); }