Example usage for android.content SyncResult getClass

List of usage examples for android.content SyncResult getClass

Introduction

In this page you can find the example usage for android.content SyncResult getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.android.tests.lib.LibUnitTest.java

@Test
public void instanceFields() throws Exception {
    SyncResult result = mock(SyncResult.class);
    Field statsField = result.getClass().getField("stats");
    SyncStats syncStats = mock(SyncStats.class);
    statsField.set(result, syncStats);//from   w ww  . j av  a2 s .c  o  m

    syncStats.numDeletes = 42;
    assertEquals(42, result.stats.numDeletes);
}