// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/ElementNotFoundException.java
// public class ElementNotFoundException extends RuntimeException {
//     public ElementNotFoundException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/MalformedDataValueException.java
// public class MalformedDataValueException extends RuntimeException {
// 
//     public MalformedDataValueException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/model/data/StringDataEntry.java
// public class StringDataEntry extends BaseDataEntry<String> {
// 
//     private String value;
// 
//     public StringDataEntry(String name) {
//         this(name, "");
//     }
// 
//     public StringDataEntry(String name, String value) {
//         super(name);
//         this.value = value;
//     }
// 
//     public StringDataEntry(String name, String value, String prompt) {
//         super(name, prompt);
//         this.value = value;
//     }
// 
//     @Override
//     public String getValue() {
//         return value;
//     }
// }


import de.fesere.hypermedia.cj.exceptions.ElementNotFoundException;
import de.fesere.hypermedia.cj.exceptions.MalformedDataValueException;
import de.fesere.hypermedia.cj.model.data.StringDataEntry;
import org.junit.Assert;
import org.junit.Test;
import java.net.URI;
import static junit.framework.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.core.Is.is;
        item.getString("doesNotExist");
    }

    @Test(expected = ElementNotFoundException.class)
    public void testDeserializeItemWithSingleDataEntryMissingInteger() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\":\"24\"}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);
        item.getInt("doesNotExist");
    }

    @Test
    public void testDeserializeItemWithSingleDataEntryContainingInt() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\":24}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);

        assertEquals(TEST_COM_ITEM, item.getHref());
        assertThat(item.getData(), contains(name("age")));
        assertThat(item.getInt("age"), is(24));
    }

    @Test(expected = MalformedDataValueException.class)
    public void testDeserializeItemWithSingleDataEntryContainingMalformedInt_exception() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\": \"24.abc\"}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);
        item.getInt("age");
    }

// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/ElementNotFoundException.java
// public class ElementNotFoundException extends RuntimeException {
//     public ElementNotFoundException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/MalformedDataValueException.java
// public class MalformedDataValueException extends RuntimeException {
// 
//     public MalformedDataValueException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/model/data/StringDataEntry.java
// public class StringDataEntry extends BaseDataEntry<String> {
// 
//     private String value;
// 
//     public StringDataEntry(String name) {
//         this(name, "");
//     }
// 
//     public StringDataEntry(String name, String value) {
//         super(name);
//         this.value = value;
//     }
// 
//     public StringDataEntry(String name, String value, String prompt) {
//         super(name, prompt);
//         this.value = value;
//     }
// 
//     @Override
//     public String getValue() {
//         return value;
//     }
// }


// Path: src/test/java/de/fesere/hypermedia/cj/model/ItemSerializationTest.java
import de.fesere.hypermedia.cj.exceptions.ElementNotFoundException;
import de.fesere.hypermedia.cj.exceptions.MalformedDataValueException;
import de.fesere.hypermedia.cj.model.data.StringDataEntry;
import org.junit.Assert;
import org.junit.Test;
import java.net.URI;
import static junit.framework.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.core.Is.is;

        item.getString("doesNotExist");
    }

    @Test(expected = ElementNotFoundException.class)
    public void testDeserializeItemWithSingleDataEntryMissingInteger() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\":\"24\"}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);
        item.getInt("doesNotExist");
    }

    @Test
    public void testDeserializeItemWithSingleDataEntryContainingInt() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\":24}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);

        assertEquals(TEST_COM_ITEM, item.getHref());
        assertThat(item.getData(), contains(name("age")));
        assertThat(item.getInt("age"), is(24));
    }

    @Test(expected = MalformedDataValueException.class)
    public void testDeserializeItemWithSingleDataEntryContainingMalformedInt_exception() {
        String givenJSON = "{\"href\":\"http://writeToStringExample.com/item/1\", \"data\":[{\"name\":\"age\", \"value\": \"24.abc\"}]}";

        Item item = serializer.deserialize(givenJSON, Item.class);
        item.getInt("age");
    }

    @Test(expected = MalformedDataValueException.class)