package com.andela.library;


public class Organization {

}

@@ -27,35 +27,2714 @@
 ;%0A%0A%0A
-public class Organization %7B
+import com.andela.library.model.Item;%0Aimport com.andela.library.model.Member;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0A%0Apublic abstract class Organization %3CB extends Item,M extends Member%3E  %7B%0A%0A    ArrayList%3CM%3E memberList;%0A    ArrayList%3CB%3E itemList;%0A%0A    int memberCounter;%0A    int itemCounter;%0A%0A    public Organization() %7B%0A        memberList = new ArrayList%3C%3E();%0A        itemList = new ArrayList%3C%3E();%0A    %7D%0A%0A    public void addItem(B item) %7B%0A        item.setId(itemCounter);%0A        itemList.add(item);%0A        itemCounter++;%0A    %7D%0A%0A    public void addAllItems(Collection%3C? extends B%3E items) %7B%0A        for (B item : items)%7B%0A            addItem(item);%0A        %7D%0A    %7D%0A%0A    public B getItem(int index) %7B%0A        return itemList.get(index);%0A    %7D%0A%0A    public ArrayList%3CB%3E getAllItems() %7B%0A        return itemList;%0A    %7D%0A%0A    public void removeItem(B item) %7B%0A        itemList.remove(item);%0A    %7D%0A%0A    public void removeItem(int index) %7B%0A        itemList.remove(index);%0A    %7D%0A%0A    public void removeAllItems(Collection%3C? extends B%3E items) %7B%0A        for (B item : items)%7B%0A            removeItem(item);%0A        %7D%0A    %7D%0A%0A    public int itemSize() %7B%0A        return itemList.size();%0A    %7D%0A%0A    public void clearItems() %7B%0A        itemList.clear();%0A    %7D%0A%0A    public void addMember(M member) %7B%0A        member.setId(memberCounter);%0A        memberList.add(member);%0A        memberCounter++;%0A    %7D%0A%0A    public void addAllMembers(Collection%3C? extends M%3E members) %7B%0A        for (M member : members)%7B%0A            addMember(member);%0A        %7D%0A    %7D%0A%0A    public M getMember(int index) %7B%0A        return memberList.get(index);%0A    %7D%0A%0A    public ArrayList%3CM%3E getAllMembers() %7B%0A        return memberList;%0A    %7D%0A%0A    public void removeMember(M member) %7B%0A        memberList.remove(member);%0A    %7D%0A%0A    public void removeMember(int index) %7B%0A        memberList.remove(index);%0A    %7D%0A%0A    public void removeAllMembers(Collection%3C? extends M%3E members) %7B%0A        for (M member : members)%7B%0A            removeMember(member);%0A        %7D%0A    %7D%0A%0A    public int memberSize() %7B%0A        return memberList.size();%0A    %7D%0A%0A    public void clearMembers() %7B%0A        memberList.clear();%0A    %7D%0A%0A    public boolean isMemberRegistered(M member) %7B%0A        return memberList.indexOf(member) != -1;%0A    %7D%0A%0A    public boolean isItemRegistered(B item)%7B%0A        return itemList.indexOf(item) != -1;%0A    %7D%0A%0A    public boolean isItemEmpty()%7B%0A        return itemList.size() == 0;%0A    %7D%0A%0A    public boolean isMemberEmpty()%7B%0A        return memberList.size() == 0;%0A    %7D%0A%0A    public boolean itemContains(B item)%7B%0A        return itemList.contains(item);%0A    %7D%0A%0A    public boolean memberContains(M member)%7B%0A        return memberList.contains(member);%0A    %7D
 %0A%0A%7D%0A

Complete Organization abstract class