ClassReferenceContext implements Reference<T> { public Reference<T> selectAttribute(String name) throws BindingException { return new PropertyReference<T>(this, type, name, this); } ClassReferenceContext(Class<T> type); ReferenceContext<T> getReferenceContext(); boolean isAssignableTo(Class<?> type); Object resolve(T context); Reference<T> selectAttribute(String name); Reference<T> selectItem(String index); Reference<T> selectItem(Expression<Integer, T> index); void document(Document target); Class<?> getType(); Reference<T> narrow(Class<?> type); boolean isBasedOn(ReferenceContext<T> other); Reference<T> rescope(ReferenceContext<T> context);  }
@Test(expected=BindingException.class) public void testInvalidReferences() { ReferenceContext<Person> context = new ClassReferenceContext<Person>( Person.class); context.selectAttribute("gender"); }