### Question:
InMemoryBinary extends AbstractBinary { public long getSize() { return this.bytes.length; } InMemoryBinary( byte[] bytes ); @Override int hashCode(); long getSize(); byte[] getHash(); byte[] getBytes(); InputStream getStream(); void acquire(); void release();  }### Answer:
@Test public void shouldConstructFromByteArray() { binary = new InMemoryBinary(validByteArrayContent); assertThat(binary.getSize(), is((long)validByteArrayContent.length)); assertThat(binary, hasContent(validByteArrayContent)); }
@Test public void shouldConstructFromEmptyByteArray() { validByteArrayContent = new byte[0]; binary = new InMemoryBinary(validByteArrayContent); assertThat(binary.getSize(), is(0l)); assertThat(binary, hasNoContent()); }
@Test public void shouldHaveSizeThatMatchesContentLength() { assertThat(binary.getSize(), is((long)validByteArrayContent.length)); }