how to check object type in java in junit code example Example: junit check class type assertTrue(objectUnderTest instanceof TargetObject);