// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public static String toFriendlyId(UUID uuid) {
// 	return Url62.encode(uuid);
// }
// 
// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public static UUID toUuid(String friendlyId) {
// 	return Url62.decode(friendlyId);
// }
// 
// Path: friendly-id/src/test/java/com/devskiller/friendly_id/IdUtil.java
// static boolean areEqualIgnoringLeadingZeros(String code1, String code2) {
// 	return areEqual(removeLeadingZeros(code1), removeLeadingZeros(code2));
// }


import io.vavr.test.Arbitrary;
import org.junit.Test;
import static com.devskiller.friendly_id.FriendlyId.toFriendlyId;
import static com.devskiller.friendly_id.FriendlyId.toUuid;
import static com.devskiller.friendly_id.IdUtil.areEqualIgnoringLeadingZeros;
import static io.vavr.test.Property.def;
import static org.assertj.core.util.Objects.areEqual;
package com.devskiller.friendly_id;



public class FriendlyIdTest {

	@Test
	public void shouldCreateValidIdsThatConformToUuidType4() {
		def("areEqual(FriendlyId.toUuid(FriendlyId.toFriendlyId(uuid))), uuid)")
				.forAll(Arbitrary.integer())
				.suchThat(ignored -> toUuid(FriendlyId.createFriendlyId()).version() == 4)
				.check(-1, 100_000)
				.assertIsSatisfied();
	}

	@Test
	public void encodingUuidShouldBeReversible() {
		def("areEqual(FriendlyId.toUuid(FriendlyId.toFriendlyId(uuid))), uuid)")
				.forAll(DataProvider.UUIDS)
// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public static String toFriendlyId(UUID uuid) {
// 	return Url62.encode(uuid);
// }
// 
// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public static UUID toUuid(String friendlyId) {
// 	return Url62.decode(friendlyId);
// }
// 
// Path: friendly-id/src/test/java/com/devskiller/friendly_id/IdUtil.java
// static boolean areEqualIgnoringLeadingZeros(String code1, String code2) {
// 	return areEqual(removeLeadingZeros(code1), removeLeadingZeros(code2));
// }


// Path: friendly-id/src/test/java/com/devskiller/friendly_id/FriendlyIdTest.java
import io.vavr.test.Arbitrary;
import org.junit.Test;
import static com.devskiller.friendly_id.FriendlyId.toFriendlyId;
import static com.devskiller.friendly_id.FriendlyId.toUuid;
import static com.devskiller.friendly_id.IdUtil.areEqualIgnoringLeadingZeros;
import static io.vavr.test.Property.def;
import static org.assertj.core.util.Objects.areEqual;

package com.devskiller.friendly_id;



public class FriendlyIdTest {

	@Test
	public void shouldCreateValidIdsThatConformToUuidType4() {
		def("areEqual(FriendlyId.toUuid(FriendlyId.toFriendlyId(uuid))), uuid)")
				.forAll(Arbitrary.integer())
				.suchThat(ignored -> toUuid(FriendlyId.createFriendlyId()).version() == 4)
				.check(-1, 100_000)
				.assertIsSatisfied();
	}

	@Test
	public void encodingUuidShouldBeReversible() {
		def("areEqual(FriendlyId.toUuid(FriendlyId.toFriendlyId(uuid))), uuid)")
				.forAll(DataProvider.UUIDS)
				.suchThat(uuid -> areEqual(toUuid(toFriendlyId(uuid)), uuid))