junit check class type code example Example: junit check class type assertTrue(objectUnderTest instanceof TargetObject);