### Question:
InstantRunAnalyticsHelper { @NonNull public static InstantRunStatus generateAnalyticsProto( @NonNull InstantRunBuildContext buildContext) { InstantRunStatus.Builder builder = InstantRunStatus.newBuilder(); builder.setBuildMode(convert(buildContext.getBuildMode())); builder.setPatchingPolicy(convert(buildContext.getPatchingPolicy())); builder.setVerifierStatus(convert(buildContext.getVerifierResult())); InstantRunBuildContext.Build last = buildContext.getLastBuild(); if (last != null) { for (InstantRunBuildContext.Artifact artifact : last.getArtifacts()) { builder.addArtifact( InstantRunArtifact.newBuilder().setType(convert(artifact.getType()))); } } return builder.build(); } private  InstantRunAnalyticsHelper(); @NonNull static InstantRunStatus generateAnalyticsProto(
            @NonNull InstantRunBuildContext buildContext);  }### Answer:
@Test public void testAnalyticsHelper() { when(mInstantRunBuildContext.getLastBuild()).thenReturn(mBuild); when(mInstantRunBuildContext.getBuildMode()).thenReturn(InstantRunBuildMode.HOT_WARM); when(mInstantRunBuildContext.getPatchingPolicy()) .thenReturn(InstantRunPatchingPolicy.MULTI_APK); when(mInstantRunBuildContext.getVerifierResult()) .thenReturn(InstantRunVerifierStatus.COMPATIBLE); when(mBuild.getArtifacts()) .thenReturn( ImmutableList.of( new InstantRunBuildContext.Artifact( FileType.RESOURCES, new File("resources.ap_")), new InstantRunBuildContext.Artifact( FileType.RELOAD_DEX, new File("reload.dex")))); InstantRunStatus proto = InstantRunAnalyticsHelper.generateAnalyticsProto(mInstantRunBuildContext); assertEquals(InstantRunStatus.BuildMode.HOT_WARM, proto.getBuildMode()); assertEquals(InstantRunStatus.PatchingPolicy.MULTI_APK, proto.getPatchingPolicy()); assertEquals(InstantRunStatus.VerifierStatus.COMPATIBLE, proto.getVerifierStatus()); assertEquals(2, proto.getArtifactCount()); List<InstantRunArtifact> artifacts = proto.getArtifactList(); assertEquals("RESOURCES", artifacts.get(0).getType().toString()); assertEquals("RELOAD_DEX", artifacts.get(1).getType().toString()); }