@@ -0,0 +1,2688 @@
+package org.monospark.spongematchers.type;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.CoreMatchers.not;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.monospark.spongematchers.testutil.HamcrestSpongeMatchers.matches;%0A%0Aimport org.junit.Test;%0Aimport org.monospark.spongematchers.matcher.SpongeMatcher;%0Aimport org.monospark.spongematchers.parser.SpongeMatcherParseException;%0Aimport org.monospark.spongematchers.parser.element.StringElement;%0Aimport org.monospark.spongematchers.parser.element.StringElementParser;%0Aimport org.spongepowered.api.data.DataContainer;%0Aimport org.spongepowered.api.data.DataQuery;%0Aimport org.spongepowered.api.data.MemoryDataContainer;%0Aimport org.spongepowered.api.item.ItemType;%0Aimport org.spongepowered.api.item.inventory.ItemStack;%0A%0Apublic class ItemStackTypeTest %7B%0A%0A    @Test%0A    public void canMatch_NonItemStackObject_ReturnsFalse() throws SpongeMatcherParseException %7B%0A        Object o = 5;%0A        %0A        boolean canMatch = MatcherType.ITEM_STACK.canMatch(o);%0A        %0A        assertThat(canMatch, is(false));%0A    %7D%0A    %0A    @Test%0A    public void canMatch_ItemStackObject_ReturnsTrue() throws Exception %7B%0A        Object o = mock(ItemStack.class);%0A%0A        boolean canMatch = MatcherType.ITEM_STACK.canMatch(o);%0A        %0A        assertThat(canMatch, is(true));%0A    %7D%0A%0A    @Test%0A    public void parseMatcher_ValidMapElement_ReturnsCorrectSpongeMatcher() throws SpongeMatcherParseException %7B%0A        StringElement element = StringElementParser.parseStringElement(%0A                %22%7B'type':'minecraft:appl.+','durability':0,'quantity':1,'data':%7B'test':1%7D%7D%22);%0A%0A        SpongeMatcher%3CItemStack%3E matcher = MatcherType.ITEM_STACK.parseMatcher(element);%0A%0A        ItemType type = mock(ItemType.class);%0A        when(type.getId()).thenReturn(%22minecraft:apple%22);%0A        ItemStack s1 = mock(ItemStack.class);%0A        when(s1.getItem()).thenReturn(type);%0A        when(s1.getQuantity()).thenReturn(1);%0A        DataContainer container1 = new MemoryDataContainer();%0A        container1.set(DataQuery.of(%22UnsafeDamage%22), 0);%0A        container1.set(DataQuery.of(%22UnsafeData%22, %22test%22), 1);%0A        when(s1.toContainer()).thenReturn(container1);%0A        assertThat(matcher, matches(s1));%0A        ItemStack s2 = mock(ItemStack.class);%0A        when(s2.getItem()).thenReturn(type);%0A        when(s2.getQuantity()).thenReturn(2);%0A        DataContainer container2 = new MemoryDataContainer();%0A        container2.set(DataQuery.of(%22UnsafeDamage%22), 1);%0A        when(s2.toContainer()).thenReturn(container2);%0A        assertThat(matcher, not(matches(s2)));%0A    %7D%0A%7D%0A

Add ItemStack matcher tests