@Override
    public boolean equals(Object toBeCompared) {
        if (toBeCompared instanceof ControllerInfo) {
            ControllerInfo that = (ControllerInfo) toBeCompared;
            return Objects.equals(this.type, that.type) &&
                    Objects.equals(this.ip, that.ip) &&
                    Objects.equals(this.port, that.port);
        }
        return false;
    }
@Test
    public void testListEquals() {
        String target1 = "ptcp:6653:192.168.1.1";
        ControllerInfo controllerInfo1 = new ControllerInfo(target1);
        String target2 = "ptcp:6653:192.168.1.1";
        ControllerInfo controllerInfo2 = new ControllerInfo(target2);
        String target3 = "tcp:192.168.1.1:6653";
        ControllerInfo controllerInfo3 = new ControllerInfo(target3);
        String target4 = "tcp:192.168.1.1:6653";
        ControllerInfo controllerInfo4 = new ControllerInfo(target4);
        List<ControllerInfo> list1 = new ArrayList<>(Arrays.asList(controllerInfo1, controllerInfo3));
        List<ControllerInfo> list2 = new ArrayList<>(Arrays.asList(controllerInfo2, controllerInfo4));
        assertTrue("wrong equals list method", list1.equals(list2));
    }