Database { public static int getInt(Cursor cursor, String columnName) { return cursor.getInt(cursor.getColumnIndexOrThrow(columnName)); } private  Database(); static String getString(Cursor cursor, String columnName); static int getInt(Cursor cursor, String columnName);  }
@Test public void should_return_int_cursor_data() { when(cursor.getColumnIndexOrThrow("column_name")).thenReturn(21); when(cursor.getInt(21)).thenReturn(10); int result = Database.getInt(cursor, "column_name"); assertThat(result).isEqualTo(10); }