class MinecraftlyUtil {

	public static long convertMillisToTicks( long milliseconds ) {
		double nearestTickTime = round( milliseconds, 50 );
		return (long) ((nearestTickTime / 1000) * 20);
	}

}

class MinecraftlyUtilTest {

	@Test
	public void tickConversionTest() {


		Assert.assertEquals( 1, MinecraftlyUtil.convertMillisToTicks( 40 ) );
		Assert.assertEquals( 1, MinecraftlyUtil.convertMillisToTicks( 50 ) );
		Assert.assertEquals( 1, MinecraftlyUtil.convertMillisToTicks( 60 ) );

		Assert.assertEquals( 3, MinecraftlyUtil.convertMillisToTicks( 140 ) );
		Assert.assertEquals( 3, MinecraftlyUtil.convertMillisToTicks( 150 ) );
		Assert.assertEquals( 3, MinecraftlyUtil.convertMillisToTicks( 160 ) );

	}

}