@Test public void testCursorEmpty() throws Exception { Cursor cursor = mock(Cursor.class); when(cursor.isClosed()).thenReturn(true); when(cursor.moveToFirst()).thenReturn(false); boolean isEmpty = SQLiteUtils.isEmptyCursor(cursor); assertTrue(isEmpty); }
public static boolean isEmptyCursor(@Nullable Cursor cursor) { if (cursor == null) { return true; } if (cursor.isClosed()) { return true; } return !cursor.moveToFirst(); }
SQLiteUtils { public static boolean isEmptyCursor(@Nullable Cursor cursor) { if (cursor == null) { return true; } if (cursor.isClosed()) { return true; } return !cursor.moveToFirst(); } }
SQLiteUtils { public static boolean isEmptyCursor(@Nullable Cursor cursor) { if (cursor == null) { return true; } if (cursor.isClosed()) { return true; } return !cursor.moveToFirst(); } private  SQLiteUtils(); }
SQLiteUtils { public static boolean isEmptyCursor(@Nullable Cursor cursor) { if (cursor == null) { return true; } if (cursor.isClosed()) { return true; } return !cursor.moveToFirst(); } private  SQLiteUtils(); static boolean isTableEmpty(@NonNull Table<T> table); static boolean isEmptyCursor(@Nullable Cursor cursor); static void safeCloseCursor(@Nullable Cursor cursor); }
SQLiteUtils { public static boolean isEmptyCursor(@Nullable Cursor cursor) { if (cursor == null) { return true; } if (cursor.isClosed()) { return true; } return !cursor.moveToFirst(); } private  SQLiteUtils(); static boolean isTableEmpty(@NonNull Table<T> table); static boolean isEmptyCursor(@Nullable Cursor cursor); static void safeCloseCursor(@Nullable Cursor cursor);  }