// Path: src/main/java/org/spearal/impl/SpearalType.java
// public enum SpearalType {
// 
// 	// No parameters (0x00...0x0f).
// 	
// 	NULL(0x00),
// 
// 	TRUE(0x01),
// 	FALSE(0x02),
// 	
// 	// 4 bits of parameters (0x10...0xf0).
// 
// 	INTEGRAL(0x10),
// 	BIG_INTEGRAL(0x20),
// 	
// 	FLOATING(0x30),
// 	BIG_FLOATING(0x40),
// 
// 	STRING(0x50),
// 	
// 	BYTE_ARRAY(0x60),
// 	
// 	DATE_TIME(0x70),
// 	
// 	COLLECTION(0x80),
// 	MAP(0x90),
// 	
// 	ENUM(0xa0),
// 	CLASS(0xb0),
// 	BEAN(0xc0);
// 	
// 	private static final SpearalType[] SIO_TYPES;
// 	static {
// 		SpearalType[] types = SpearalType.values();
// 		SIO_TYPES = new SpearalType[0xf0 + 1];
// 		
// 		for (SpearalType type : types) {
// 			int id = type.id;
// 			if (id < 0 || id > 0xf0 || (id != 0 && (id & 0xf0) != 0 && (id & 0x0f) != 0))
// 				throw new ExceptionInInitializerError("Illegal type id: " + id);
// 			if (SIO_TYPES[id] != null)
// 				throw new ExceptionInInitializerError("Duplicated ids: " + SIO_TYPES[id] + " / " + type);
// 			SIO_TYPES[id] = type;
// 		}
// 	}
// 	
// 	private final int id;
// 	
// 	SpearalType(int id) {
// 		this.id = id;
// 	}
// 	
// 	public int id() {
// 		return id;
// 	}
// 	
// 	public static SpearalType valueOf(int parameterizedType) {
// 		
// 		if (parameterizedType >= 0x10) {
// 			if (parameterizedType <= 0xff) {
// 				SpearalType type = SIO_TYPES[parameterizedType & 0xf0];
// 				if (type != null)
// 					return type;
// 			}
// 		}
// 		else if (parameterizedType >= 0) {
// 			SpearalType type = SIO_TYPES[parameterizedType];
// 			if (type != null)
// 				return type;
// 		}
// 		
// 		throw new IllegalArgumentException("Illegal parameterized type: " + parameterizedType);
// 	}
// }


import org.junit.Assert;
import org.junit.Test;
import org.spearal.impl.SpearalType;
		}
		
		for (int i = 0x10; i <= 0xff; i++) {
			try {
				SpearalType type = SpearalType.valueOf(i);
				Assert.assertEquals((i & 0xf0), type.id());
			}
			catch (IllegalArgumentException e) {
				Assert.assertNull(findTypeWithId(i & 0xf0));
			}
		}
		
		parameterizedType = 0xff + 1;
		try {
			SpearalType.valueOf(parameterizedType);
			Assert.fail("Should throw an exception: " + parameterizedType);
		}
		catch (IllegalArgumentException e) {
		}
		
		parameterizedType = Integer.MAX_VALUE;
		try {
			SpearalType.valueOf(parameterizedType);
			Assert.fail("Should throw an exception: " + parameterizedType);
		}
		catch (IllegalArgumentException e) {
		}
	}
	
	private static SpearalType findTypeWithId(int id) {
// Path: src/main/java/org/spearal/impl/SpearalType.java
// public enum SpearalType {
// 
// 	// No parameters (0x00...0x0f).
// 	
// 	NULL(0x00),
// 
// 	TRUE(0x01),
// 	FALSE(0x02),
// 	
// 	// 4 bits of parameters (0x10...0xf0).
// 
// 	INTEGRAL(0x10),
// 	BIG_INTEGRAL(0x20),
// 	
// 	FLOATING(0x30),
// 	BIG_FLOATING(0x40),
// 
// 	STRING(0x50),
// 	
// 	BYTE_ARRAY(0x60),
// 	
// 	DATE_TIME(0x70),
// 	
// 	COLLECTION(0x80),
// 	MAP(0x90),
// 	
// 	ENUM(0xa0),
// 	CLASS(0xb0),
// 	BEAN(0xc0);
// 	
// 	private static final SpearalType[] SIO_TYPES;
// 	static {
// 		SpearalType[] types = SpearalType.values();
// 		SIO_TYPES = new SpearalType[0xf0 + 1];
// 		
// 		for (SpearalType type : types) {
// 			int id = type.id;
// 			if (id < 0 || id > 0xf0 || (id != 0 && (id & 0xf0) != 0 && (id & 0x0f) != 0))
// 				throw new ExceptionInInitializerError("Illegal type id: " + id);
// 			if (SIO_TYPES[id] != null)
// 				throw new ExceptionInInitializerError("Duplicated ids: " + SIO_TYPES[id] + " / " + type);
// 			SIO_TYPES[id] = type;
// 		}
// 	}
// 	
// 	private final int id;
// 	
// 	SpearalType(int id) {
// 		this.id = id;
// 	}
// 	
// 	public int id() {
// 		return id;
// 	}
// 	
// 	public static SpearalType valueOf(int parameterizedType) {
// 		
// 		if (parameterizedType >= 0x10) {
// 			if (parameterizedType <= 0xff) {
// 				SpearalType type = SIO_TYPES[parameterizedType & 0xf0];
// 				if (type != null)
// 					return type;
// 			}
// 		}
// 		else if (parameterizedType >= 0) {
// 			SpearalType type = SIO_TYPES[parameterizedType];
// 			if (type != null)
// 				return type;
// 		}
// 		
// 		throw new IllegalArgumentException("Illegal parameterized type: " + parameterizedType);
// 	}
// }


// Path: src/test/java/org/spearal/test/TestSpearalType.java
import org.junit.Assert;
import org.junit.Test;
import org.spearal.impl.SpearalType;

		}
		
		for (int i = 0x10; i <= 0xff; i++) {
			try {
				SpearalType type = SpearalType.valueOf(i);
				Assert.assertEquals((i & 0xf0), type.id());
			}
			catch (IllegalArgumentException e) {
				Assert.assertNull(findTypeWithId(i & 0xf0));
			}
		}
		
		parameterizedType = 0xff + 1;
		try {
			SpearalType.valueOf(parameterizedType);
			Assert.fail("Should throw an exception: " + parameterizedType);
		}
		catch (IllegalArgumentException e) {
		}
		
		parameterizedType = Integer.MAX_VALUE;
		try {
			SpearalType.valueOf(parameterizedType);
			Assert.fail("Should throw an exception: " + parameterizedType);
		}
		catch (IllegalArgumentException e) {
		}
	}
	
	private static SpearalType findTypeWithId(int id) {
		for (SpearalType type : SpearalType.values()) {