Class templateClass = resourceClass;
while (templateClass != Object.class)
{
templateClass = templateClass.getSuperclass();
final RestLiTemplate templateAnnotation = (RestLiTemplate) templateClass.getAnnotation(RestLiTemplate.class);
if (templateAnnotation != null)
{
final Class<? extends Annotation> currentExpect = templateAnnotation.expectedAnnotation();
if (currentExpect == RestLiCollection.class ||
currentExpect == RestLiAssociation.class ||
currentExpect == RestLiSimpleResource.class)
{
if (resourceClass.getAnnotation(currentExpect) == null)