public static Entity getEntity(Value value) {
    if (value.getValueTypeCase() != ValueTypeCase.ENTITY_VALUE) {
      throw new IllegalArgumentException("Value does not contain an Entity.");
    }
    return value.getEntityValue();
  }
public static Entity getEntity ( Value value ) { if ( value . getValueTypeCase ( ) != ValueTypeCase . ENTITY_VALUE ) { throw new IllegalArgumentException ( "Value does not contain an Entity." ) ; } return value . getEntityValue ( ) ; }
@return the entity contained in value
@throws IllegalArgumentException if the value does not contain an entity.