DBInstanceImpl implements DBInstance { @Override public String getInstanceId() { return instanceMeta.getInstanceId(); } DBInstanceImpl(StorageServiceFactory storageServiceFactory, MetadataStore metadataStore, Instance instanceMeta); @Override String getInstanceId(); @Override List<Bag> getBags(); @Override Bag getBag(String bagName); @Override void removeBag(String bagName); @Override String getPath();  }
@Test public void testGetInstanceId() { when(instanceMeta.getInstanceId()).thenReturn("instance1"); DBInstanceImpl dbInstance = new DBInstanceImpl(storageServiceFactory, metadataStore, instanceMeta); assertThat(dbInstance.getInstanceId(), is("instance1")); }