- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {StringBuilder s =
new StringBuilder()
new StringBuilder(32)
String str;new StringBuilder(str)
- Smart code suggestions by Codota
}
/** * Test that new instance is correctly created based on the delegate indexer settings. */ @Test public void newInstance() { when(delegateIndexer.sharedInstance()).thenReturn(true); IStorageBranchIndexer<DefaultData> instance = storageBranchIndexer.getNewInstance(); verify(delegateIndexer, times(0)).getNewInstance(); assertThat(instance, is(instanceOf(StorageBranchIndexer.class))); assertThat(((StorageBranchIndexer<DefaultData>) instance).getDelegateIndexer(), is(delegateIndexer)); when(delegateIndexer.sharedInstance()).thenReturn(false); instance = storageBranchIndexer.getNewInstance(); verify(delegateIndexer, times(1)).getNewInstance(); assertThat(instance, is(instanceOf(StorageBranchIndexer.class))); assertThat(((StorageBranchIndexer<DefaultData>) instance).getDelegateIndexer(), is(not(delegateIndexer))); } }
when(childIndexer.getNewInstance()).thenReturn(mock(IStorageBranchIndexer.class)); when(childIndexer.getNewInstance()).thenReturn(mock(IStorageBranchIndexer.class));
} else { IStorageBranchIndexer<E> indexer = childIndexer.getNewInstance(); if (passId) { indexer.setId(id);