public List<Object> resolveValidParams(Collection<Object> params) {
        List<Object> validParams = new ArrayList<>();
        int size = 0;
        for (Object param : params) {
            int s = calculateParamTransportSize(param);
            if (s <= 0) {
                RecordLog.warn("[ParamFlowRequestDataWriter] WARN: Non-primitive type detected in params of "
                        + "cluster parameter flow control, which is not supported: " + param);
                continue;
            }
            if (size + s > maxParamByteSize) {
                RecordLog.warn("[ParamFlowRequestDataWriter] WARN: params size is too big." +
                        " the configure value is : " + maxParamByteSize + ", the params size is: " + params.size());
                break;
            }
            size += s;
            validParams.add(param);
        }
        return validParams;
    }
@Test
    public void testResolveValidParams() {

        final int maxSize = 15;
        ParamFlowRequestDataWriter writer = new ParamFlowRequestDataWriter(maxSize);

        ArrayList<Object> params = new ArrayList<Object>() {{
            add(1);
            add(64);
            add(3);
        }};

        List<Object> validParams = writer.resolveValidParams(params);
        assertTrue(validParams.contains(1) && validParams.contains(64) && validParams.contains(3));

        //when over maxSize, the exceed number should not be contained
        params.add(5);
        assertFalse(writer.resolveValidParams(params).contains(5));


        //POJO (non-primitive type) should not be regarded as a valid parameter
        assertTrue(writer.resolveValidParams(new ArrayList<Object>() {{
            add(new SomePojo());
        }}).size() == 0);

    }