private boolean isImmutable(final Class<?> clz){
  final Boolean isIm=immutables.get(clz);
  if (isIm != null)   return isIm;
  if (considerImmutable(clz))   return true;
  final Class<?> immutableAnnotation=getImmutableAnnotation();
  for (  final Annotation annotation : clz.getDeclaredAnnotations()) {
    if (annotation.annotationType() == immutableAnnotation) {
      immutables.put(clz,Boolean.TRUE);
      return true;
    }
  }
  Class<?> c=clz.getSuperclass();
  while (c != null && c != Object.class) {
    for (    final Annotation annotation : c.getDeclaredAnnotations()) {
      if (annotation.annotationType() == Immutable.class) {
        final Immutable im=(Immutable)annotation;
        if (im.subClass()) {
          immutables.put(clz,Boolean.TRUE);
          return true;
        }
      }
    }
    c=c.getSuperclass();
  }
  immutables.put(clz,Boolean.FALSE);
  return false;
}

private boolean isImmutable ( final Class < ? > clz ) { final Boolean isIm = immutables . get ( clz ) ; if ( isIm != null ) return isIm ; if ( considerImmutable ( clz ) ) return true ; final Class < ? > immutableAnnotation = getImmutableAnnotation ( ) ; for ( final Annotation annotation : clz . getDeclaredAnnotations ( ) ) { if ( annotation . annotationType ( ) == immutableAnnotation ) { immutables . put ( clz , Boolean . TRUE ) ; return true ; } } Class < ? > c = clz . getSuperclass ( ) ; while ( c != null && c != Object . class ) { for ( final Annotation annotation : c . getDeclaredAnnotations ( ) ) { if ( annotation . annotationType ( ) == Immutable . class ) { final Immutable im = ( Immutable ) annotation ; if ( im . subClass ( ) ) { immutables . put ( clz , Boolean . TRUE ) ; return true ; } } } c = c . getSuperclass ( ) ; } immutables . put ( clz , Boolean . FALSE ) ; return false ; }
decides if a class is to be considered immutable or not
