BinaryAdapters { public static BinaryExtract extractionCarrier(ByteBuffer buffer) { if (buffer == null) { throw new NullPointerException(); } return new BinaryExtractAdapter(buffer); } private  BinaryAdapters(); static BinaryExtract extractionCarrier(ByteBuffer buffer); static BinaryInject injectionCarrier(ByteBuffer buffer);  }
@Test public void testExtractBinary() { ByteBuffer buff = ByteBuffer.wrap(new byte[0]); BinaryExtract binary = BinaryAdapters.extractionCarrier(buff); assertEquals(buff, binary.extractionBuffer()); }
@Test(expected = NullPointerException.class) public void testExtractBinaryNull() { BinaryAdapters.extractionCarrier(null); }