// Path: fernet-java8/src/main/java/com/macasaet/fernet/Constants.java
// static final int initializationVectorBytes = 16;


import static com.macasaet.fernet.Constants.initializationVectorBytes;
import static java.util.stream.Collectors.toList;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.mutabilitydetector.unittesting.AllowedReason.allowingForSubclassing;
import static org.mutabilitydetector.unittesting.AllowedReason.assumingFields;
import static org.mutabilitydetector.unittesting.AllowedReason.provided;
import static org.mutabilitydetector.unittesting.MutabilityAssert.assertInstancesOf;
import static org.mutabilitydetector.unittesting.MutabilityMatchers.areImmutable;
import java.security.SecureRandom;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.IntStream;
import javax.crypto.spec.IvParameterSpec;
import org.junit.Before;
import org.junit.Test;
        assertEquals("Hello, world!", plainText);
    }

    @Test
    public void testGenerateEmptyToken() {
        // given
        final SecureRandom deterministicRandom = new SecureRandom() {
            private static final long serialVersionUID = 3075400891983079965L;

            public void nextBytes(final byte[] bytes) {
                for (int i = bytes.length; --i >= 0; bytes[i] = 1);
            }
        };
        final Key key = Key.generateKey(deterministicRandom);

        // when
        final Token result = Token.generate(deterministicRandom, key, "");

        // then
        final String plainText = result.validateAndDecrypt(key, validator);
        assertEquals("", plainText);
    }

    @Test
    public void testDecryptKey() {
        // given
        final SecureRandom deterministicRandom = new SecureRandom() {
            private static final long serialVersionUID = 3075400891983079965L;

            public void nextBytes(final byte[] bytes) {
// Path: fernet-java8/src/main/java/com/macasaet/fernet/Constants.java
// static final int initializationVectorBytes = 16;


// Path: fernet-java8/src/test/java/com/macasaet/fernet/TokenTest.java
import static com.macasaet.fernet.Constants.initializationVectorBytes;
import static java.util.stream.Collectors.toList;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.mutabilitydetector.unittesting.AllowedReason.allowingForSubclassing;
import static org.mutabilitydetector.unittesting.AllowedReason.assumingFields;
import static org.mutabilitydetector.unittesting.AllowedReason.provided;
import static org.mutabilitydetector.unittesting.MutabilityAssert.assertInstancesOf;
import static org.mutabilitydetector.unittesting.MutabilityMatchers.areImmutable;
import java.security.SecureRandom;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.IntStream;
import javax.crypto.spec.IvParameterSpec;
import org.junit.Before;
import org.junit.Test;

        assertEquals("Hello, world!", plainText);
    }

    @Test
    public void testGenerateEmptyToken() {
        // given
        final SecureRandom deterministicRandom = new SecureRandom() {
            private static final long serialVersionUID = 3075400891983079965L;

            public void nextBytes(final byte[] bytes) {
                for (int i = bytes.length; --i >= 0; bytes[i] = 1);
            }
        };
        final Key key = Key.generateKey(deterministicRandom);

        // when
        final Token result = Token.generate(deterministicRandom, key, "");

        // then
        final String plainText = result.validateAndDecrypt(key, validator);
        assertEquals("", plainText);
    }

    @Test
    public void testDecryptKey() {
        // given
        final SecureRandom deterministicRandom = new SecureRandom() {
            private static final long serialVersionUID = 3075400891983079965L;

            public void nextBytes(final byte[] bytes) {
                for (int i = initializationVectorBytes; --i >= 0; bytes[i] = 1);