XLogUtils { static String getClassNameSection(String className, int section) { int sectionSize = getClassNameSectionSize(className); if (className == null || section <= 0 || section >= sectionSize) { return className; } int index = 0; while (section > 0) { index++; if ('.' == className.charAt(index)) { section--; } } return className.substring(0, index); } private  XLogUtils(); static Set<String> getRemainingClassNames(Set<Class<?>> classes,
            Set<String> classNames); static boolean shouldLogMember(List<XLogMethod> xLogMethods, Member member); static boolean filterResult(String className, XLogSetting xLogSetting); static List<String> getPkgPrefixesForCoarseMatch(List<String> classNames,
            int pkgSectionSize); static List<String> getPkgPrefixesForCoarseMatchXLogMethods(List<XLogMethod> xLogMethods,
            int pkgSectionSize); static final int TYPE_METHOD; static final int TYPE_CONSTRUCTOR; static final String PKG_NAME; static final String CLASS_NAME; static final String FIELD_NAME_METHODS; static final String FIELD_NAME_CLASSES; }
@Test public void testGetClassNameSection() { assertThat(XLogUtils.getClassNameSection("", 0), is("")); assertThat(XLogUtils.getClassNameSection(null, 0), nullValue()); assertThat(XLogUtils.getClassNameSection("com", -1), is("com")); assertThat(XLogUtils.getClassNameSection("com", 2), is("com")); assertThat(XLogUtils.getClassNameSection("com.promegu", 1), is("com")); assertThat(XLogUtils.getClassNameSection("com.promegu", 2), is("com.promegu")); assertThat(XLogUtils.getClassNameSection("com.promegu.xlog.base", 2), is("com.promegu")); assertThat(XLogUtils.getClassNameSection("com.promegu.xlog.base", 4), is("com.promegu.xlog.base")); }