### Question:
KernelData extends LifecycleAdapter { public final String instanceId() { return instanceId; } KernelData( FileSystemAbstraction fs, PageCache pageCache, File storeDir, Config configuration, DataSourceManager dataSourceManager ); final String instanceId(); Version version(); File getStoreDir(); Config getConfig(); PageCache getPageCache(); FileSystemAbstraction getFilesystemAbstraction(); DataSourceManager getDataSourceManager(); @Override void shutdown(); @Override final int hashCode(); @Override final boolean equals( Object obj );  }### Answer:
@Test public void shouldGenerateUniqueInstanceIdentifiers() { Kernel kernel1 = new Kernel( null ); Kernel kernel2 = new Kernel( null ); assertNotNull( kernel1.instanceId() ); assertNotNull( kernel2.instanceId() ); assertNotEquals( kernel1.instanceId(), kernel2.instanceId() ); }
@Test public void shouldAllowConfigurationOfInstanceId() { Kernel kernel = new Kernel( "myInstance" ); assertEquals( "myInstance", kernel.instanceId() ); }
@Test public void shouldGenerateInstanceIdentifierWhenNullConfigured() { Kernel kernel = new Kernel( null ); assertEquals( kernel.instanceId(), kernel.instanceId().trim() ); assertTrue( kernel.instanceId().length() > 0 ); }
@Test public void shouldGenerateInstanceIdentifierWhenEmptyStringConfigured() { Kernel kernel = new Kernel( "" ); assertEquals( kernel.instanceId(), kernel.instanceId().trim() ); assertTrue( kernel.instanceId().length() > 0 ); }