### Question:
FilePerIndexDirectory extends ColumnIndexDirectory { @Override public PinotDataBuffer newBuffer(String column, ColumnIndexType type, long sizeBytes) throws IOException { IndexKey key = new IndexKey(column, type); return getWriteBufferFor(key, sizeBytes); } protected  FilePerIndexDirectory(File segmentDirectory, SegmentMetadataImpl metadata, ReadMode readMode); @Override PinotDataBuffer getBuffer(String column, ColumnIndexType type); @Override PinotDataBuffer newBuffer(String column, ColumnIndexType type, long sizeBytes); @Override boolean hasIndexFor(String column, ColumnIndexType type); @Override void close(); @Override void removeIndex(String columnName, ColumnIndexType indexType); @Override boolean isIndexRemovalSupported();  }### Answer:
@Test(expectedExceptions = RuntimeException.class) public void testWriteExisting() throws Exception { try (FilePerIndexDirectory columnDirectory = new FilePerIndexDirectory(TEMP_DIR, segmentMetadata, ReadMode.mmap)) { columnDirectory.newBuffer("column1", ColumnIndexType.DICTIONARY, 1024); } try (FilePerIndexDirectory columnDirectory = new FilePerIndexDirectory(TEMP_DIR, segmentMetadata, ReadMode.mmap)) { columnDirectory.newBuffer("column1", ColumnIndexType.DICTIONARY, 1024); } }