BasePackageDetector { public static String detect(String sourcePath) { File sourceDirectory = new File(sourcePath); if (sourceDirectory.exists()) { String pkg = detectInMavenProject(sourceDirectory); return pkg.isEmpty() ? pkg : pkg + "."; } else { return ""; } }  static Set<String> scan(File sourceDirectory); static String detect(String sourcePath); static String detect();  }
@Test void test() throws IOException { Assertions.assertThat(BasePackageDetector.detect("target/basedetect")) .isEqualTo("hoge.fuga."); }