### Question:
GifHeaderParser { @NonNull public GifHeader parseHeader() { if (rawData == null) { throw new IllegalStateException("You must call setData() before parseHeader()"); } if (err()) { return header; } readHeader(); if (!err()) { readContents(); if (header.frameCount < 0) { header.status = STATUS_FORMAT_ERROR; } } return header; }  GifHeaderParser setData(@NonNull ByteBuffer data); GifHeaderParser setData(@Nullable byte[] data); void clear(); @NonNull GifHeader parseHeader(); boolean isAnimated();  }### Answer:
@Test(expected = IllegalStateException.class) public void testThrowsIfParseHeaderCalledBeforeSetData() { GifHeaderParser parser = new GifHeaderParser(); parser.parseHeader(); }