public static String fromNamedReference(CharSequence s) {
        if (s == null) {
            return null;
        }
        final Integer code = SPECIALS.get(s.toString());
        if (code != null) {
            return "&#" + code + ";";
        }
        return null;
    }
@Test
    public void testFromNamedReference() {
        CharSequence s = null;
        String expResult = null;
        String result = XmlEntity.fromNamedReference(s);
        assertEquals(expResult, result);

        s = "somethingWrong";
        expResult = null;
        result = XmlEntity.fromNamedReference(s);
        assertEquals(expResult, result);

        s = "amp";
        expResult = "&#38;";
        result = XmlEntity.fromNamedReference(s);
        assertEquals(expResult, result);
        
        s = "acute";
        expResult = "&#180;";
        result = XmlEntity.fromNamedReference(s);
        assertEquals(expResult, result);
    }