NamesUtil { public static boolean isQualifiedName(String name) { return stripGenericQualifier(name).indexOf(".")>=0; } private  NamesUtil(); static boolean isJavaLangClassName(String identifier); static boolean isJavaUtilClassName(String identifier); static String makeSafeJavaIdentifier(String identifier); static String createNewClassNameFromInterfaceName(String interfaceName); static String getGenericQualifier(String className); static String[] getGenericQualifierNames(String className); static boolean hasGenericQualifier(String name); static String stripGenericQualifier(String className); static String stripArrrayQualifier(String className); static String ensureQualifedName(String name, String defaultPackage); static boolean isQualifiedName(String name); static String getUnqualifiedName(String name); static String getPackageFromQualifiedName(String name); static boolean hasPackage(String qualifiedName, String packageName); static boolean isGetterMethod(String methodName, String[] getterPrefixes); static boolean isSetterMethod(String methodName, String[] setterPrefixes); static String getWrapperTypeName(String typeName); static boolean hasWilcard(String wildcardSpecifier); static boolean matchingOverloads(String overloadNamesSpecifier1, String overloadNamesSpecifier2, boolean ignoreAllPackages); static final String ImplClassSuffix; }
@Test public void testIsQualifiedForUnQualifiedName() { boolean isQualified = NamesUtil.isQualifiedName("Comparable"); Assert.assertFalse("Class name not constructed correctly", isQualified); }
@Test public void testIsQualifiedForUnQualifiedGenericName() { boolean isQualified = NamesUtil.isQualifiedName("Comparable<java.lang.String>"); Assert.assertFalse("Class name not constructed correctly", isQualified); }
@Test public void testIsQualifiedForQualifiedName() { boolean isQualified = NamesUtil.isQualifiedName("java.lang.Comparable"); Assert.assertTrue("Class name not constructed correctly", isQualified); }