@Test
public void testGetNamesOfIdPropertiesFromASingleClassHavingAFieldAnnotatedWithId() throws Exception {

    // GIVEN
    final String simpleClassName = "EntityClass";
    final String idPropertyName = "key";
    final JPackage jp = jCodeModel.rootPackage();
    final JDefinedClass jClass = jp._class(JMod.PUBLIC, simpleClassName);
    jClass.annotate(Entity.class);
    jClass.field(JMod.PRIVATE, String.class, idPropertyName).annotate(Id.class);
    buildModel(testFolder.getRoot(), jCodeModel);
    compileModel(testFolder.getRoot());
    final Class<?> entityClass = loadClass(testFolder.getRoot(), jClass.name());
    // WHEN
    final List<String> namesOfIdProperties = EntityUtils.getNamesOfIdProperties(entityClass);
    // THEN
    assertThat(namesOfIdProperties.size(), equalTo(1));
    assertThat(namesOfIdProperties, hasItem(idPropertyName));
}