public static CharSequence trimOws(CharSequence value) {
        final int length = value.length();
        if (length == 0) {
            return value;
        }
        int start = indexOfFirstNonOwsChar(value, length);
        int end = indexOfLastNonOwsChar(value, start, length);
        return start == 0 && end == length - 1 ? value : value.subSequence(start, end + 1);
    }
@Test
    public void trimOws() {
        assertSame("", StringUtil.trimOws(""));
        assertEquals("", StringUtil.trimOws(" \t "));
        assertSame("a", StringUtil.trimOws("a"));
        assertEquals("a", StringUtil.trimOws(" a"));
        assertEquals("a", StringUtil.trimOws("a "));
        assertEquals("a", StringUtil.trimOws(" a "));
        assertSame("abc", StringUtil.trimOws("abc"));
        assertEquals("abc", StringUtil.trimOws("\tabc"));
        assertEquals("abc", StringUtil.trimOws("abc\t"));
        assertEquals("abc", StringUtil.trimOws("\tabc\t"));
        assertSame("a\t b", StringUtil.trimOws("a\t b"));
        assertEquals("", StringUtil.trimOws("\t ").toString());
        assertEquals("a b", StringUtil.trimOws("\ta b \t").toString());
    }