@Test
public void testInstanceOfNarrowingNez_dalvik() throws IOException {

    MethodImplementationBuilder builder = new MethodImplementationBuilder(2);

    builder.addInstruction(new BuilderInstruction22c(Opcode.INSTANCE_OF, 0, 1,
            new ImmutableTypeReference("Lmain;")));
    builder.addInstruction(new BuilderInstruction21t(Opcode.IF_NEZ, 0, builder.getLabel("instance_of")));
    builder.addInstruction(new BuilderInstruction10x(Opcode.RETURN_VOID));

    builder.addLabel("instance_of");
    builder.addInstruction(new BuilderInstruction10x(Opcode.RETURN_VOID));

    MethodImplementation methodImplementation = builder.getMethodImplementation();

    Method method = new ImmutableMethod("Lmain;", "narrowing",
            Collections.singletonList(new ImmutableMethodParameter("Ljava/lang/Object;", null, null)), "V",
            AccessFlags.PUBLIC.getValue(), null, null, methodImplementation);
    ClassDef classDef = new ImmutableClassDef("Lmain;", AccessFlags.PUBLIC.getValue(), "Ljava/lang/Object;", null,
            null, null, null, Collections.singletonList(method));
    DexFile dexFile = new ImmutableDexFile(Opcodes.getDefault(), Collections.singletonList(classDef));

    ClassPath classPath = new ClassPath(new DexClassProvider(dexFile));
    MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, null, false);

    List<AnalyzedInstruction> analyzedInstructions = methodAnalyzer.getAnalyzedInstructions();
    Assert.assertEquals("Ljava/lang/Object;",
            analyzedInstructions.get(2).getPreInstructionRegisterType(1).type.getType());

    Assert.assertEquals("Ljava/lang/Object;",
            analyzedInstructions.get(3).getPreInstructionRegisterType(1).type.getType());
}