### Question:
ParamFlowRequestDataWriter implements EntityWriter<ParamFlowRequestData, ByteBuf> { 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; } ParamFlowRequestDataWriter();  ParamFlowRequestDataWriter(int maxParamByteSize); @Override void writeTo(ParamFlowRequestData entity, ByteBuf target); List<Object> resolveValidParams(Collection<Object> params);  }### Answer:
@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)); params.add(5); assertFalse(writer.resolveValidParams(params).contains(5)); assertTrue(writer.resolveValidParams(new ArrayList<Object>() {{ add(new SomePojo()); }}).size() == 0); }