@Test
public void testIsInstance() {

    // check non primitives first
    checkIsInstance(true, Object.class, null);
    checkIsInstance(true, Object.class, "String");
    checkIsInstance(true, String.class, "String");
    checkIsInstance(false, Integer.class, "String");
    // null primitive
    checkIsInstance(false, int.class, null);
    // then primitives.
    // We check each for a match, and then both a non-match against a primitive and object
    checkIsInstancePrimitive(boolean.class, true);
    checkIsInstancePrimitive(char.class, 'a');
    checkIsInstancePrimitive(byte.class, (byte) 1);
    checkIsInstancePrimitive(short.class, (short) 1);
    checkIsInstancePrimitive(int.class, 1);
    checkIsInstancePrimitive(long.class, 1L);
    checkIsInstancePrimitive(float.class, 1.0f);
    checkIsInstancePrimitive(double.class, 1.0);
}