@Override
    public List<String> choices() {
        if (commandLine.getArguments() == null) {
            return Collections.emptyList();
        }
        List<String> argList = Lists.newArrayList();

        String argOne = null;
        if (argList.size() > 1) {
            argOne = argList.get(1);
        }
        VplsCommandEnum vplsCommandEnum = VplsCommandEnum.enumFromString(argOne);
        if (vplsCommandEnum != null) {
            switch (vplsCommandEnum) {
                case CREATE:
                case LIST:
                    return Collections.emptyList();
                default:
                    VplsCommandEnum.toStringList();
            }
        }
        return VplsCommandEnum.toStringList();
    }
@Test
    public void testOptArgCompleter() {
        VplsOptArgCompleter completer = new VplsOptArgCompleter();
        completer.vpls = new TestVpls();
        ((TestVpls) completer.vpls).initSampleData();
        completer.interfaceService = new TestInterfaceService();

        // Add interface to VPLS
        commandSession.updateArguments(VPLS_CMD, VplsCommandEnum.ADD_IFACE.toString(), VPLS1);

        List<String> choices = completer.choices();
        List<String> expected = ImmutableList.of(V300H1.name(),
                                                 V300H2.name(),
                                                 V400H1.name(),
                                                 VNONEH1.name(),
                                                 VNONEH2.name(),
                                                 VNONEH3.name());

        // Can not ensure the order, use contains all instead of equals
        assertEquals(choices.size(), expected.size());
        assertTrue(choices.containsAll(expected));

        // Removes interface from VPLS
        commandSession.updateArguments(VPLS_CMD, VplsCommandEnum.REMOVE_IFACE.toString(), VPLS1);
        choices = completer.choices();
        expected = completer.vpls.getVpls(VPLS1).interfaces().stream()
                .map(Interface::name)
                .collect(Collectors.toList());

        // Can not ensure the order, use contains all instead of equals
        assertEquals(choices.size(), expected.size());
        assertTrue(choices.containsAll(expected));

        // Sets encapsulation
        commandSession.updateArguments(VPLS_CMD, VplsCommandEnum.SET_ENCAP.toString(), VPLS1);
        choices = completer.choices();
        expected = Arrays.stream(EncapsulationType.values())
                .map(Enum::toString)
                .collect(Collectors.toList());

        // Can not ensure the order, use contains all instead of equals
        assertEquals(choices.size(), expected.size());
        assertTrue(choices.containsAll(expected));
    }