<commit_before>package core.time;

import org.junit.Test;

import java.time.LocalTime;

import static org.junit.Assert.assertEquals;

public class LocalTimeTest {

	@Test
	public void createCurrentTime() {
		// Use static method 'now' to create time object with current time
		LocalTime time = LocalTime.now();
	}

	@Test
	public void createCustomTime() {
		// Use static method 'of' to create custom time object
		LocalTime t1 = LocalTime.of(10, 30);
		checkTime(t1, 10, 30, 0, 0);

		LocalTime t2 = LocalTime.of(10, 30, 15);
		checkTime(t2, 10, 30, 15, 0);

		LocalTime t3 = LocalTime.of(10, 30, 15, 100);
		checkTime(t3, 10, 30, 15, 100);
	}

	private void checkTime(LocalTime time, int hour, int minute, int second, long nano) {
		assertEquals(time.getHour(), hour);
		assertEquals(time.getMinute(), minute);
		assertEquals(time.getSecond(), second);
		assertEquals(time.getNano(), nano);
	}

	@Test
	public void checkPlusTime() {
		LocalTime t = LocalTime.of(10, 30);
		assertEquals(t.plusHours(10), LocalTime.of(20, 30));
		assertEquals(t.plusMinutes(10), LocalTime.of(10, 40));
		assertEquals(t.plusSeconds(10), LocalTime.of(10, 30, 10));
		assertEquals(t.plusNanos(1000), LocalTime.of(10, 30, 0, 1000));
	}

	@Test
	public void checkMinusTime() {
		LocalTime t = LocalTime.of(10, 30);
		assertEquals(t.minusHours(10), LocalTime.of(0, 30));
		assertEquals(t.minusMinutes(10), LocalTime.of(10, 20));
		assertEquals(t.minusSeconds(10), LocalTime.of(10, 29, 50));
		assertEquals(t.minusNanos(1000), LocalTime.of(10, 29, 59, 999999000));
	}
}<commit_msg>Introduced tests for LocalTime<commit_after>package core.time;

import org.junit.Test;

import java.time.LocalTime;

import static org.junit.Assert.assertEquals;

public class LocalTimeTest {

	@Test
	public void createCurrentTime() {
		// Use static method 'now' to create time object with current time
		LocalTime time = LocalTime.now();
	}

	@Test
	public void createCustomTime() {
		// Use static methods 'of' to create custom time objects
		// Set hour and minutes
		LocalTime t1 = LocalTime.of(10, 30);
		checkTime(t1, 10, 30, 0, 0);

		// Set hour, minutes and seconds
		LocalTime t2 = LocalTime.of(10, 30, 15);
		checkTime(t2, 10, 30, 15, 0);

		// Set hour, minutes, seconds and nanoseconds
		LocalTime t3 = LocalTime.of(10, 30, 15, 100);
		checkTime(t3, 10, 30, 15, 100);
	}

	private void checkTime(LocalTime time, int hour, int minute, int second, long nano) {
		assertEquals(time.getHour(), hour);
		assertEquals(time.getMinute(), minute);
		assertEquals(time.getSecond(), second);
		assertEquals(time.getNano(), nano);
	}

	@Test
	public void checkPlusTime() {
		// Add hours, minutes, seconds or nanoseconds
		LocalTime t = LocalTime.of(10, 30);
		assertEquals(t.plusHours(10), LocalTime.of(20, 30));
		assertEquals(t.plusMinutes(10), LocalTime.of(10, 40));
		assertEquals(t.plusSeconds(10), LocalTime.of(10, 30, 10));
		assertEquals(t.plusNanos(1000), LocalTime.of(10, 30, 0, 1000));
	}

	@Test
	public void checkMinusTime() {
		// Subtract hours, minutes, seconds or nanoseconds
		LocalTime t = LocalTime.of(10, 30);
		assertEquals(t.minusHours(10), LocalTime.of(0, 30));
		assertEquals(t.minusMinutes(10), LocalTime.of(10, 20));
		assertEquals(t.minusSeconds(10), LocalTime.of(10, 29, 50));
		assertEquals(t.minusNanos(1000), LocalTime.of(10, 29, 59, 999999000));
	}
}
{'fraction_non_alphanumeric': 0.1450792701166617, 'fraction_numerical': 0.07538139395752318, 'mean_word_length': 4.667796610169492, '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': '5617844', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1155, 'n_words': 308}