@Test
  public void should_encode_xbBoolean_into_SosSweBoolean_with_correct_value_and_definition()
      throws OwsExceptionReport {
    BooleanType xbBoolean = BooleanType.Factory.newInstance();
    final boolean value = true;
    xbBoolean.setValue(value);
    xbBoolean.setDefinition(definition);

    Object decodedObject = decoder.decode(xbBoolean);

    assertThat(decodedObject.getClass().getName(), is(SweBoolean.class.getName()));

    SweBoolean sosBoolean = (SweBoolean) decodedObject;

    assertThat(sosBoolean.getValue(), is(value));
    assertThat(sosBoolean.getDefinition(), is(definition));
  }
  @Test
  public void
      should_encode_xbCategory_into_SosSweCategory_with_correct_value_definition_and_codespace()
          throws OwsExceptionReport, XmlException {
    final String codeSpace = "test-codespace";
    final String value = "test-category-value";

    CategoryType xbCategory = CategoryType.Factory.newInstance();
    xbCategory.addNewCodeSpace().setHref(codeSpace);
    xbCategory.setValue(value);
    xbCategory.setDefinition(definition);

    Object decodedObject = decoder.decode(xbCategory);

    assertThat(decodedObject.getClass().getName(), is(SweCategory.class.getName()));

    SweCategory sosCategory = (SweCategory) decodedObject;

    assertThat(sosCategory.getValue(), is(value));
    assertThat(sosCategory.getDefinition(), is(definition));
    assertThat(sosCategory.getCodeSpace(), is(codeSpace));
  }