<commit_before>package beginner;

import static com.sandwich.koan.constant.KoanConstants.__;
import static com.sandwich.util.Assert.assertEquals;

import com.sandwich.koan.Koan;

public class AboutPrimitives {

	@Koan
	public void wholeNumbersAreOfTypeInt() {
		assertEquals(getType(1), int.class); // hint: int.class
	}

	@Koan
	public void primitivesOfTypeIntHaveAnObjectTypeInteger() {
		Object number = 1;
		assertEquals(getType(number), Integer.class);

		// Primitives can be automatically changed into their object type via a process called auto-boxing
		// We will explore this in more detail in intermediate.AboutAutoboxing
	}

	@Koan
	public void integersHaveAFairlyLargeRange() {
		assertEquals(Integer.MIN_VALUE, -2147483648);
		assertEquals(Integer.MAX_VALUE, 2147483647);
	}

	@Koan
	public void integerSize() {
		assertEquals(Integer.SIZE, 32);  // This is the amount of bits used to store an int
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeLong() {
		assertEquals(getType(1L), long.class);
	}

	@Koan
	public void primitivesOfTypeLongHaveAnObjectTypeLong() {
		Object number = 1L;
		assertEquals(getType(number), Long.class);
	}

	@Koan
	public void longsHaveALargerRangeThanInts() {
		assertEquals(Long.MIN_VALUE, -9223372036854775808L);
		assertEquals(Long.MAX_VALUE, 9223372036854775807L);
	}

	@Koan
	public void longSize() {
		assertEquals(Long.SIZE, 64);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeShort() {
		assertEquals(getType((short) 1), short.class); // The '(short)' is called an explicit cast - to type 'short'
	}

	@Koan
	public void primitivesOfTypeShortHaveAnObjectTypeShort() {
		Object number = (short) 1;
		assertEquals(getType(number), Short.class);
	}

	@Koan
	public void shortsHaveASmallerRangeThanInts() {
		assertEquals(Short.MIN_VALUE, (short)-32768);  // hint: You'll need an explicit cast
		assertEquals(Short.MAX_VALUE, (short)32767);
	}

	@Koan
	public void shortSize() {
		assertEquals(Short.SIZE, 16);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeByte() {
		assertEquals(getType((byte) 1), byte.class);
	}

	@Koan
	public void primitivesOfTypeByteHaveAnObjectTypeByte() {
		Object number = (byte) 1;
		assertEquals(getType(number), Byte.class);
	}

	@Koan
	public void bytesHaveASmallerRangeThanShorts() {
		assertEquals(Byte.MIN_VALUE, (byte)-128);
		assertEquals(Byte.MAX_VALUE, __);

		// Why would you use short or byte considering that you need to do explicit casts?
	}

	@Koan
	public void byteSize() {
		assertEquals(Byte.SIZE, __);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeChar() {
		assertEquals(getType((char) 1), __);
	}

	@Koan
	public void singleCharactersAreOfTypeChar() {<commit_msg>Asserting that byte have a smaller range than short<commit_after>package beginner;

import static com.sandwich.koan.constant.KoanConstants.__;
import static com.sandwich.util.Assert.assertEquals;

import com.sandwich.koan.Koan;

public class AboutPrimitives {

	@Koan
	public void wholeNumbersAreOfTypeInt() {
		assertEquals(getType(1), int.class); // hint: int.class
	}

	@Koan
	public void primitivesOfTypeIntHaveAnObjectTypeInteger() {
		Object number = 1;
		assertEquals(getType(number), Integer.class);

		// Primitives can be automatically changed into their object type via a process called auto-boxing
		// We will explore this in more detail in intermediate.AboutAutoboxing
	}

	@Koan
	public void integersHaveAFairlyLargeRange() {
		assertEquals(Integer.MIN_VALUE, -2147483648);
		assertEquals(Integer.MAX_VALUE, 2147483647);
	}

	@Koan
	public void integerSize() {
		assertEquals(Integer.SIZE, 32);  // This is the amount of bits used to store an int
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeLong() {
		assertEquals(getType(1L), long.class);
	}

	@Koan
	public void primitivesOfTypeLongHaveAnObjectTypeLong() {
		Object number = 1L;
		assertEquals(getType(number), Long.class);
	}

	@Koan
	public void longsHaveALargerRangeThanInts() {
		assertEquals(Long.MIN_VALUE, -9223372036854775808L);
		assertEquals(Long.MAX_VALUE, 9223372036854775807L);
	}

	@Koan
	public void longSize() {
		assertEquals(Long.SIZE, 64);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeShort() {
		assertEquals(getType((short) 1), short.class); // The '(short)' is called an explicit cast - to type 'short'
	}

	@Koan
	public void primitivesOfTypeShortHaveAnObjectTypeShort() {
		Object number = (short) 1;
		assertEquals(getType(number), Short.class);
	}

	@Koan
	public void shortsHaveASmallerRangeThanInts() {
		assertEquals(Short.MIN_VALUE, (short)-32768);  // hint: You'll need an explicit cast
		assertEquals(Short.MAX_VALUE, (short)32767);
	}

	@Koan
	public void shortSize() {
		assertEquals(Short.SIZE, 16);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeByte() {
		assertEquals(getType((byte) 1), byte.class);
	}

	@Koan
	public void primitivesOfTypeByteHaveAnObjectTypeByte() {
		Object number = (byte) 1;
		assertEquals(getType(number), Byte.class);
	}

	@Koan
	public void bytesHaveASmallerRangeThanShorts() {
		assertEquals(Byte.MIN_VALUE, (byte)-128);
		assertEquals(Byte.MAX_VALUE, (byte)127);

		// Why would you use short or byte considering that you need to do explicit casts?
	}

	@Koan
	public void byteSize() {
		assertEquals(Byte.SIZE, __);
	}

	@Koan
	public void wholeNumbersCanAlsoBeOfTypeChar() {
		assertEquals(getType((char) 1), __);
	}

	@Koan
	public void singleCharactersAreOfTypeChar() {
{'fraction_non_alphanumeric': 0.1066469172375486, 'fraction_numerical': 0.032401407146824664, 'mean_word_length': 4.995560488346282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '117075', 'n_tokens_mistral': 2041, 'n_tokens_neox': 1770, 'n_words': 425}