//
CommandDescriptor<Instance<A>> desc = CommandFactory.DEFAULT.create(A.class);
CompletionMatcher<Instance<A>> matcher = desc.completer();
//
CompletionMatch a = new CompletionMatch(Delimiter.EMPTY, Completion.builder("").add("SOURCE", true).add("CLASS", true).add("RUNTIME", true).build());
CompletionMatch b = new CompletionMatch(Delimiter.DOUBLE_QUOTE, Completion.builder("").add("SOURCE", true).add("CLASS", true).add("RUNTIME", true).build());
CompletionMatch c = new CompletionMatch(Delimiter.SINGLE_QUOTE, Completion.builder("").add("SOURCE", true).add("CLASS", true).add("RUNTIME", true).build());
CompletionMatch d = new CompletionMatch(Delimiter.EMPTY, Completion.create("SOU", "RCE", true));
CompletionMatch e = new CompletionMatch(Delimiter.DOUBLE_QUOTE, Completion.create("SOU", "RCE", true));
CompletionMatch f = new CompletionMatch(Delimiter.SINGLE_QUOTE, Completion.create("SOU", "RCE", true));
CompletionMatch g = new CompletionMatch(Delimiter.EMPTY, Completion.create("SOURCE", "", true));
CompletionMatch h = new CompletionMatch(Delimiter.EMPTY, Completion.create("SOURCE", "", true));
//
for (String m : Arrays.asList("foo -a", "bar")) {
assertEquals("testing " + m, a, matcher.match(m + " "));
assertEquals("testing " + m, b, matcher.match(m + " \""));