RealObjectFieldTracker { void clear() { for (FieldInfo info : mMappedFields) { info.setValue(null); } for (FieldInfo info : mUnmappedFields) { info.setValue(null); } mMappedFields.clear(); mUnmappedFields.clear(); } RealObjectFieldTracker(
      RealObjectMapping realObjectMapping,
      RealObjectMaker realObjectMaker,
      DependencyProviderFactory dependencyProviderFacotry);   }
@Test public void testClear() { TestClass1WithUnmapped testObject = new TestClass1WithUnmapped(); TestRunnable valueForRunnableKey = new TestRunnable(); TestRunnable valueForTestRunnableKey = new TestRunnable(); when(mBlankDependencyProvider.get(runnableKey)).thenReturn(valueForRunnableKey); when(mRealObjectMaker.createObject(null, testRunnableKey.typeToken)) .thenReturn(valueForTestRunnableKey); mRealObjectFieldTracker.scanNullRealObjectFields(testObject); mRealObjectFieldTracker.applyValuesToFields(); assertThat(testObject.mRealRunnableWithImpl) .isNotNull() .isEqualTo(valueForRunnableKey); assertThat(testObject.mRealTestRunnable) .isNotNull() .isEqualTo(valueForTestRunnableKey); assertThat(testObject.mRealRunnableWithImpl2) .isNotNull() .isEqualTo(valueForTestRunnableKey); assertThat(testObject.mRealTestRunnable2) .isNotNull() .isEqualTo(valueForTestRunnableKey); mRealObjectFieldTracker.clear(); assertThat(testObject.mRealRunnableWithImpl).isNull(); assertThat(testObject.mRealTestRunnable).isNull(); assertThat(testObject.mRealRunnableWithImpl2).isNull(); assertThat(testObject.mRealTestRunnable2).isNull(); }