### Question:
RealBufferedSource implements BufferedSource { @Override public void require(long byteCount) throws IOException { if (!request(byteCount)) throw new EOFException(); } RealBufferedSource(Source source, Buffer buffer);  RealBufferedSource(Source source); @Override Buffer buffer(); @Override long read(Buffer sink, long byteCount); @Override boolean exhausted(); @Override void require(long byteCount); @Override boolean request(long byteCount); @Override byte readByte(); @Override ByteString readByteString(); @Override ByteString readByteString(long byteCount); @Override byte[] readByteArray(); @Override byte[] readByteArray(long byteCount); @Override int read(byte[] sink); @Override void readFully(byte[] sink); @Override int read(byte[] sink, int offset, int byteCount); @Override void readFully(Buffer sink, long byteCount); @Override long readAll(Sink sink); @Override String readUtf8(); @Override String readUtf8(long byteCount); @Override String readString(Charset charset); @Override String readString(long byteCount, Charset charset); @Override String readUtf8Line(); @Override String readUtf8LineStrict(); @Override int readUtf8CodePoint(); @Override short readShort(); @Override short readShortLe(); @Override int readInt(); @Override int readIntLe(); @Override long readLong(); @Override long readLongLe(); @Override long readDecimalLong(); @Override long readHexadecimalUnsignedLong(); @Override void skip(long byteCount); @Override long indexOf(byte b); @Override long indexOf(byte b, long fromIndex); @Override long indexOf(ByteString bytes); @Override long indexOf(ByteString bytes, long fromIndex); @Override long indexOfElement(ByteString targetBytes); @Override long indexOfElement(ByteString targetBytes, long fromIndex); @Override InputStream inputStream(); @Override void close(); @Override Timeout timeout(); @Override String toString(); final Buffer buffer; final Source source; }### Answer:
@Test public void requireInsufficientData() throws Exception { Buffer source = new Buffer(); source.writeUtf8("a"); BufferedSource bufferedSource = new RealBufferedSource(source); try { bufferedSource.require(2); fail(); } catch (EOFException expected) { } }