package pl.grzeslowski.jsupla.protocol.common.randomizers.sdc;

import io.github.benas.randombeans.api.Randomizer;
import pl.grzeslowski.jsupla.protocol.api.structs.sdc.SuplaVersionError;
import pl.grzeslowski.jsupla.protocol.common.RandomBean;

public class SuplaVersionErrorRandomizer implements Randomizer<SuplaVersionError> {
    private final RandomBean randomBean;

    public SuplaVersionErrorRandomizer(final RandomBean randomBean) {
        this.randomBean = randomBean;
    }

    @Override
    public SuplaVersionError getRandomValue() {
        return new SuplaVersionError(
                                            randomBean.nextUnsignedByte(),
                                            randomBean.nextUnsignedByte()

        );
    }
}

@@ -538,24 +538,174 @@
 omValue() %7B%0A
+        final short serverVersion = randomBean.nextUnsignedByte();%0A        final short serverVersionMin = randomBean.nextUnsignedByte(serverVersion);%0A
         retu
@@ -778,37 +778,24 @@
     
-randomBean.nextUnsignedByte()
+serverVersionMin
 ,%0A  
@@ -840,37 +840,21 @@
     
-randomBean.nextUnsignedByte()
+serverVersion
 %0A%0A  

Version min needs to be smaller than version