code: public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException {
  		if (!(nameClassPair instanceof Binding)) {
  			throw new IllegalArgumentException("Parameter must be an instance of Binding");
  		}
  
  		Binding binding = (Binding) nameClassPair;
          Object object = binding.getObject();
          if (object == null) {
              throw new ObjectRetrievalException(
                      "Binding did not contain any object.");
          }
          return mapper.mapFromContext(object);
      }
docs: Cast the NameClassPair to a {@link Binding} and pass its object to
  the ContextMapper.
  
  @param nameClassPair
  a Binding instance.
  @return the Object returned from the mapper.
  @throws NamingException if an error occurs.
  @throws ObjectRetrievalException if the object of the nameClassPair is null.