FontFamily extends AbstractCssProperty<FontFamily> { protected static String[] getExtractedFamilyNames(final String familyNames, final boolean validate) { final String[] parts = StringUtil.splitByComma(familyNames); int count = 0; for (final String each : parts) { final String trimmed = StringUtil.strip(each); final char firstChar; final char lastChar; if (trimmed.length() > 0) { firstChar = trimmed.charAt(0); lastChar = trimmed.charAt(trimmed.length() - 1); } else { firstChar = 0; lastChar = 0; } final boolean startsWith = firstChar == '"' || firstChar == '\''; int begin = 0; if (startsWith) { begin = 1; } final boolean endsWith = lastChar == '"' || lastChar == '\''; int end = trimmed.length(); if (endsWith) { end = end - 1; } final String familyName = trimmed.substring(begin, end); if (validate && !FONT_FAMILY_NAMES .contains(TagStringUtil.toLowerCase(familyName))) { throw new InvalidValueException("font-family name " + familyName + " is not valid against the family names added by addFontFamilyName and addFontFamilyNames methods"); } parts[count] = familyName; count++; } return parts; } FontFamily();  FontFamily(final String cssValue);  FontFamily(final String... fontFamilyNames);  FontFamily(final FontFamily fontFamily); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override FontFamily setCssValue(final String cssValue); void setFontFamilyNames(final String[] fontFamilyNames); String[] getFontFamilyNames(); void setAsInitial(); void setAsInherit(); static void addFontFamilyName(final String fontFamilyName); static void addFontFamilyNames(
            final Collection<String> fontFamilyNames); Set<String> getAddedFontFamilyNames(); boolean isValidateFontFamilyName(); void setValidateFontFamilyName(
            final boolean validateFontFamilyName); static boolean isValidateFontFamilyNameGlobally(); static void setValidateFontFamilyNameGlobally(
            final boolean validateFontFamilyNameGlobally); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; static final String[] EMPTY_ARRAY; }
@Test public void testGetExtractedFamilyNames() { String[] extractedFamilyNames = FontFamily.getExtractedFamilyNames("\"Times New Roman\", Georgia, " + GenericFontFamilyNameContants.SERIF, false); assertEquals(3, extractedFamilyNames.length); assertEquals("Times New Roman", extractedFamilyNames[0]); assertEquals("Georgia", extractedFamilyNames[1]); assertEquals(GenericFontFamilyNameContants.SERIF, extractedFamilyNames[2]); }