### Question:
B2HeadersImpl implements B2Headers { public static Builder builder() { return new Builder(); } private  B2HeadersImpl(Map<String, String> pairs); @Override Collection<String> getNames(); @Override String getValueOrNull(String name); static Builder builder(); static Builder builder(B2Headers headersOrNull); @Override String toString();  }### Answer:
@Test public void testGetContentLengthWithBogusValue() { final B2Headers withBogusContentLength = B2HeadersImpl .builder() .set(B2Headers.CONTENT_LENGTH, "non-numerical") .build(); thrown.expect(IllegalStateException.class); thrown.expectMessage("can't parse Content-Length 'non-numerical' as a long: java.lang.NumberFormatException: For input string: \"non-numerical\""); withBogusContentLength.getContentLength(); }
@Test public void testGetContentSha1EvenIfUnverifiedOrNull_andActuallyUnverified() { final B2Headers headers = B2HeadersImpl .builder() .set(B2Headers.CONTENT_SHA1, "unverified:" + SAMPLE_SHA1) .build(); assertEquals(SAMPLE_SHA1, headers.getContentSha1EvenIfUnverifiedOrNull()); assertNull(makeEmpty().getContentSha1OrNull()); }
@Test public void testGetSrcLastModifiedMillis() { assertEquals(SAMPLE_LAST_MODIFIED_LONG, makeNormal().getSrcLastModifiedMillis()); assertNull(makeEmpty().getSrcLastModifiedMillis()); final B2Headers withBogusSrcLastModifiedMillis = B2HeadersImpl .builder() .set(B2Headers.SRC_LAST_MODIFIED_MILLIS, "non-numerical") .build(); assertNull(withBogusSrcLastModifiedMillis.getSrcLastModifiedMillis()); }