Code example for FileLock

Methods: isShared

0
	 * @tests java.nio.channels.FileLock#isShared() 
	 */ 
	public void test_isShared() { 
		assertFalse(mockLock.isShared());
		FileLock lock = new MockFileLock(null, 0, 10, true);
		assertTrue(lock.isShared());
	} 
 
	/** 
	 * @tests java.nio.channels.FileLock#overlaps(long, long) 
	 */ 
	public void test_overlaps_JJ() { 
		assertTrue(mockLock.overlaps(0, 11));
		assertFalse(mockLock.overlaps(0, 10));
		assertTrue(mockLock.overlaps(100, 110));
		assertTrue(mockLock.overlaps(99, 110));
		assertFalse(mockLock.overlaps(-1, 10));
        //Harmony-671 regression test 
        assertTrue(mockLock.overlaps(1, 120));
        assertTrue(mockLock.overlaps(20, 50));
Experience pair programming with AI  Get Codota for Java