@Override
    public String loopbackEthOnu(String target) {
        DriverHandler handler = handler();
        NetconfController controller = handler.get(NetconfController.class);
        MastershipService mastershipService = handler.get(MastershipService.class);
        DeviceId ncDeviceId = handler.data().deviceId();
        checkNotNull(controller, "Netconf controller is null");
        String reply = null;
        String[] data = null;
        String[] ethId = null;

        if (!mastershipService.isLocalMaster(ncDeviceId)) {
            log.warn("Not master for {} Use {} to execute command",
                     ncDeviceId,
                     mastershipService.getMasterFor(ncDeviceId));
            return null;
        }

        data = target.split(COLON);
        if (data.length > TWO) {
            log.error("Invalid number of parameters {}", target);
            return null;
        }

        ethId = checkIdString(data[FIRST_PART], THREE);
        if (ethId == null) {
            log.error("Invalid ETH port identifier {}", data[FIRST_PART]);
            return null;
        }

        if (data.length > ONE) {
            if (!LOOPBACKMODES.contains(data[SECOND_PART])) {
                log.error("Unsupported parameter: {}", data[SECOND_PART]);
                return null;
            }
        }

        try {
            StringBuilder request = new StringBuilder();
            request.append(ANGLE_LEFT + ONU_ETHPORT_LOOPBACK + SPACE);
            request.append(VOLT_NE_NAMESPACE + ANGLE_RIGHT + NEW_LINE);

            request.append(buildStartTag(PONLINK_ID, false))
                .append(ethId[FIRST_PART])
                .append(buildEndTag(PONLINK_ID))
                .append(buildStartTag(ONU_ID, false))
                .append(ethId[SECOND_PART])
                .append(buildEndTag(ONU_ID))
                .append(buildStartTag(ETHPORT_ID, false))
                .append(ethId[THIRD_PART])
                .append(buildEndTag(ETHPORT_ID));
            if (data.length > ONE) {
                request.append(buildStartTag(LOOPBACK_MODE, false))
                    .append(data[SECOND_PART])
                    .append(buildEndTag(LOOPBACK_MODE));
            }
            request.append(buildEndTag(ONU_ETHPORT_LOOPBACK));

            reply = controller
                    .getDevicesMap()
                    .get(ncDeviceId)
                    .getSession()
                    .doWrappedRpc(request.toString());
        } catch (NetconfException e) {
            log.error("Cannot communicate to device {} exception {}", ncDeviceId, e);
        }
        return reply;
    }
@Test
    public void testInvalidEthLoopbackOnuInput() throws Exception {
        String target;
        String reply;

        for (int i = ZERO; i < INVALID_ETHPORT_LOOPBACK_TCS.length; i++) {
            target = INVALID_ETHPORT_LOOPBACK_TCS[i];
            reply = voltConfig.loopbackEthOnu(target);
            assertNull("Incorrect response for INVALID_ETHPORT_LOOPBACK_TCS", reply);
        }
    }