Skip to content

Commit f819281

Browse files
committed
Add instanceof quiz test
1 parent 36ef37e commit f819281

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/pl/mperor/interview/tasks/QuizQuestionsTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,12 @@ public void testThrowableInheritanceHierarchy() {
310310
assertInstanceOf(Throwable.class, new Error());
311311
assertInstanceOf(Exception.class, new RuntimeException());
312312
}
313+
314+
@Test
315+
public void testInstanceofIsNull() {
316+
// Is instanceof null check necessary? What happens if null is passed?"
317+
318+
assertFalse(null instanceof Object);
319+
assertTrue("null" instanceof Object);
320+
}
313321
}

0 commit comments

Comments
 (0)