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