code: public <T extends HalRepresentation> Optional<T> getResourceAs(final Class<T> type) throws IOException {
          return getResourceAs(type, null);
      }
docs: Return the selected resource and return it in the specified type.
  <p>
  If there are multiple matching representations, the first node is returned.
  </p>
  @param type the subtype of the HalRepresentation used to parse the resource.
  @param <T> the subtype of HalRepresentation of the returned resource.
  @return HalRepresentation
  @throws IOException if a low-level I/O problem (unexpected end-of-input, network error) occurs.
  @throws JsonParseException if the json document can not be parsed by Jackson's ObjectMapper
  @throws JsonMappingException if the input JSON structure can not be mapped to the specified HalRepresentation type
  @since 1.0.0