public static boolean _isReferenceType(JavaType jtype) {

        return Arrays.asList("com.google.common.base.Optional", "java.util.Optional")
                .contains(jtype.getRawClass().getCanonicalName()) || jtype.isReferenceType();
    }
@Test(description = "AtomicReference should be reference type")
    public void testIsReferenceTypeWithAtomicReference() {
        final JavaType referredType = TypeFactory.defaultInstance().constructType(String.class);
        final Class<AtomicReference> rawType = AtomicReference.class;
        final JavaType atomicReferenceType = TypeFactory.defaultInstance().constructReferenceType(rawType, referredType);

        final boolean actualIsReferenceType = ReferenceTypeUtils._isReferenceType(atomicReferenceType);

        Assert.assertEquals(actualIsReferenceType, true, rawType.getCanonicalName() + " should be reference type but was not.");
    }