// instanceof Checks whether object is instance of a given class
Object obj = new String("Hello World!");
// obj is instance of String and as such first msg is printed out
if(obj instanceof String) {
System.out.println(obj + " is instance of String class"); // This msg is printed
} else {
System.out.println(obj + " is not instance of String class");
}
@Test
public void givenWhenInstanceIsCorrect_thenReturnTrue() {
Ring ring = new Ring();
Assert.assertTrue(ring instanceof Round);
}