public void testUnsupportedMethods() { RealmResults<AllTypes> result = testRealm.where(AllTypes.class).findAll(); try { //noinspection deprecation result.add(null); fail(); } catch (UnsupportedOperationException ignored) { } try { result.set(0, null); fail(); } catch (UnsupportedOperationException ignored) { } }