
import java.beans.*;

public class AnonymousTest {

    public static void main(String[] args) throws Exception {

        I ref = new I() {
            @BeanProperty(description = "get 42", expert = true, preferred = true)
            @Override
            public double get42() { return 42; }
        };

        BeanInfo i = Introspector.getBeanInfo(ref.getClass(), Object.class);
        PropertyDescriptor d[] = i.getPropertyDescriptors();
        if (d.length < 1) { System.out.println("no descriptors"); }
        else {
            PropertyDescriptor p = d[0];
            System.out.println(p.getShortDescription() + ", " +
                p.isPreferred() + ", " + p.isExpert());
        }
    }
}
