### Question:
CodeCompleter { public List<CodeCompletionHint> complete(String incompletePath) { List<CodeCompletionHint> hints = new ArrayList<CodeCompletionHint>(); String objectPath = null; String prefix = null; String lastDelimiter = null; int lastSplit = splitter.lastSplit(incompletePath); if (lastSplit == -1) { prefix = incompletePath; } else { objectPath = incompletePath.substring(0, lastSplit); prefix = incompletePath.substring(lastSplit + 1); lastDelimiter = incompletePath.substring(lastSplit, lastSplit + 1); } if (objectPath == null) { hints = completeFromBindings(prefix); } else { String[] splitObjectPath = splitter.split(objectPath); List<Class<?>> resolvedTypes = resolveTypes(splitObjectPath); hints = completeForTypes(resolvedTypes, prefix, objectPath + lastDelimiter); } return hints; } CodeCompleter(); void addVariableBindings(Bindings bindings); void setVariableBindings(Set<Bindings> bindings); void setSplitter(PrefixSplitter splitter); List<CodeCompletionHint> complete(String incompletePath);  }### Answer:
@Test public void testRootCompletion() { List<CodeCompletionHint> hints = completer.complete("runtim"); Assert.assertEquals(1, hints.size()); CodeCompletionHint hint = hints.get(0); Assert.assertEquals("runtimeService", hint.getCompletedIdentifier()); Assert.assertEquals("RuntimeServiceImpl", hint.getCompletedType()); }
@Test public void testMethodCompletion() { List<CodeCompletionHint> hints = completer.complete("runtimeService.signalEventR"); Assert.assertEquals(4, hints.size()); }
@Test public void testNestedMethodCompletion() { List<CodeCompletionHint> hints = completer.complete("runtimeService.createMessageCorrelation('aMessage').setV"); Assert.assertEquals(2, hints.size()); }