protected void setEncap(String vplsName, String encap) {
        if (vplsName == null) {
            print(INSERT_VPLS_NAME);
            return;
        }
        if (encap == null) {
            print(INSERT_ENCAP_TYPE);
            return;
        }
        VplsData vplsData = vpls.getVpls(vplsName);
        if (vplsData == null) {
            print(VPLS_NOT_FOUND, vplsName);
            return;
        }
        EncapsulationType encapType = EncapsulationType.enumFromString(encap);
        if (encapType.equals(EncapsulationType.NONE) &&
            !encapType.toString().equals(encap)) {
            print(ENCAP_NOT_FOUND, encap);
            return;
        }
        vpls.setEncapsulationType(vplsData, encapType);
    }
@Test
    public void testSetEncap() {
        ((TestVpls) vplsCommand.vpls).initSampleData();

        // Sets to NONE
        vplsCommand.command = VplsCommandEnum.SET_ENCAP.toString();
        vplsCommand.vplsName = VPLS1;
        vplsCommand.optArg = EncapsulationType.NONE.name();
        vplsCommand.doExecute();
        VplsData result = vplsCommand.vpls.getVpls(VPLS1);
        assertEquals(result.encapsulationType(), EncapsulationType.NONE);

        // Sets to VLAN
        vplsCommand.command = VplsCommandEnum.SET_ENCAP.toString();
        vplsCommand.vplsName = VPLS1;
        vplsCommand.optArg = EncapsulationType.VLAN.name();
        vplsCommand.doExecute();
        result = vplsCommand.vpls.getVpls(VPLS1);
        assertEquals(result.encapsulationType(), EncapsulationType.VLAN);

        // Sets to MPLS
        vplsCommand.command = VplsCommandEnum.SET_ENCAP.toString();
        vplsCommand.vplsName = VPLS1;
        vplsCommand.optArg = EncapsulationType.MPLS.name();
        vplsCommand.doExecute();
        result = vplsCommand.vpls.getVpls(VPLS1);
        assertEquals(result.encapsulationType(), EncapsulationType.MPLS);
    }