@Test
public void testExecute() throws Exception {

    testOIDGenerator.execute();
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    String classOutputFolder = targetDir().getAbsolutePath() + "/generated-test-sources";
    Iterable<String> options = Arrays.asList("-d", classOutputFolder);
    JavaFileObject fileObject = new JavaSourceFromString(IF_ENTRY_CLASS_NAME, changedFileBuilder.toString());
    Iterable<? extends JavaFileObject> iterableFileObjects = Arrays.asList(fileObject);
    JavaCompiler.CompilationTask compilationTask = compiler.getTask(null, null, null, options, null,
            iterableFileObjects);
    // compiler has been observed to fail to write errors either to provided Writer or to DiagnosticCollector,
    // Oracle SE 1.7.0_45-b18
    assertTrue("Compilation failed, see stderr above", compilationTask.call());
    Class<?> ifEntryClass = null;
    URLClassLoader classLoader = URLClassLoader.newInstance(new URL[]{new File(classOutputFolder).toURI().toURL()});
    ifEntryClass = classLoader.loadClass(IF_ENTRY_CLASS_NAME);
    List<String> testMethodNames = Arrays.asList("getIfDescr", "getIfMtu", "setIfMtu", "setIfDescr");
    assertNotNull("ifEntryClass is null", ifEntryClass);
    for (Method method : ifEntryClass.getMethods()) {
        if (testMethodNames.contains(method.getName())) {
            OID oid = method.getAnnotation(OID.class);
            assertNotNull("OID for method" + method.getName() + " was null", oid);
        }
    }
}