AssertJUnit.assertEquals(testTextAsBytes.length + 3, metadata.getSize());
assert null != cache.get(new ChunkCacheKey(INDEXNAME, "MyNewFile.txt", 0, DirectoryBuilderImpl.DEFAULT_BUFFER_SIZE));
// test contents by reading:
IndexInput ii = dir.openInput("MyNewFile.txt", IOContext.DEFAULT);
assert ii.readByte() == 1;
assert ii.readByte() == 2;
assert ii.readByte() == 3;
byte[] buf = new byte[testTextAsBytes.length];
ii.readBytes(buf, 0, testTextAsBytes.length);