Category Archives: TestNG

Check if string is isomorphic

package test5; import java.util.TreeMap; import org.testng.annotations.Test; /** * Check if a string is isomporpic * @author asharda * */ public class TestIsomorphic { public boolean validate(String s,String t) { char []sc=s.toCharArray(); char []tc=t.toCharArray(); TreeMap<Character,Character> sMap=new TreeMap<Character,Character>(); TreeMap<Character,Character> tMap=new TreeMap<Character,Character>(); for(Character … Continue reading

Posted in Data Structures, Java 8, LeetCode Solutions, TestNG, Uncategorized | Leave a comment

Using Mockito and Testng in Java

I am using maven and have imported maven dependency for Mockito . import static org.mockito.Mockito.*; import java.util.List; import org.testng.annotations.Test; public class TestMockito { /** * Test Mockito using Java and TestNG. */ @Test public void testmock() { @SuppressWarnings(“unchecked”) List<String> list … Continue reading

Posted in Java, TestNG, Uncategorized | Leave a comment