public static String parseBoundaryFromHeader(String contentTypeHeader) {
        if (contentTypeHeader == null) {
            return null;
        }
        final Matcher matcher = BOUNDARY_FROM_HEADER_REGEXP.matcher(contentTypeHeader);
        return matcher.find() ? matcher.group(1) : null;
    }
@Test
    public void testParseBoundaryFromHeader() {
        assertNull(MultipartUtils.parseBoundaryFromHeader(null));

        assertEquals("0aA'()+_,-./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"0aA'()+_,-./:=?\""));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"0aA'()+_, -./:=?\""));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"0aA'()+_, -./:=? \""));

        assertEquals("0aA'()+_,-./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=0aA'()+_,-./:=?"));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=0aA'()+_, -./:=?"));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=0aA'()+_, -./:=? "));

        assertEquals(" 0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary= 0aA'()+_, -./:=?"));

        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundar=0aA'()+_, -./:=? "));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; "));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype;"));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype"));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary="));

        assertEquals("0aA'()+_,",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=0aA'()+_,; -./:=? "));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"0aA'()+_, -./:=?"));

        assertEquals("0aA'()+_, -./:=?",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=0aA'()+_, -./:=?\""));

        assertEquals("1234567890123456789012345678901234567890123456789012345678901234567890",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; "
                        + "boundary=1234567890123456789012345678901234567890123456789012345678901234567890"));

        assertEquals("1234567890123456789012345678901234567890123456789012345678901234567890",
                MultipartUtils.parseBoundaryFromHeader("multipart/subtype; "
                        + "boundary=12345678901234567890123456789012345678901234567890123456789012345678901"));

        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary="));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"\""));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=;123"));
        assertNull(MultipartUtils.parseBoundaryFromHeader("multipart/subtype; boundary=\"\"123"));
    }