Trip implements Serializable, Comparable<Trip>, Cloneable { public final void deleteItem(final UUID parUUID) { TripItem toDeleteItem = null; for (TripItem oneItem : mListItem) { if (oneItem.getUUID().compareTo(parUUID) == 0) { toDeleteItem = oneItem; } } if (toDeleteItem != null) { mListItem.remove(toDeleteItem); } setTotalWeight(recomputeTotalWeight(ALL_ITEMS)); setPackedWeight(recomputeTotalWeight(PACKED_ITEMS_ONLY)); } Trip();  Trip(final String parName,
                final GregorianCalendar parStartDate,
                final GregorianCalendar parEndDate,
                final String parNote,
                final SortModes parSortMode); final void setNote(final String parNote); final String getNote(); final @Nullable String getName(); @SuppressWarnings("WeakerAccess") final void setName(final String parName); final GregorianCalendar getStartDate(); @SuppressWarnings("WeakerAccess") final void setStartDate(final GregorianCalendar parStartDate); final GregorianCalendar getEndDate(); @SuppressWarnings("WeakerAccess") final void setEndDate(final GregorianCalendar parEndDate); @NonNull final UUID getUUID(); final TripItem addItem(final Item parItem); final TripItem addItem(final String parName); @SuppressWarnings("WeakerAccess") final void addItem(final TripItem parItem); final int getTotalWeight(); final int getPackedWeight(); @NonNull final List<TripItem> getListOfItems(); final void deleteItem(final UUID parUUID); final void unpackAll(); final void setSortMode(final SortModes parSortMode); final SortModes getSortMode(); final boolean alreadyContainsItem(final Item parItem); final long getRemainingDays(); @Override final boolean equals(final Object parO); @Override final int hashCode(); @Override final int compareTo(@NonNull final Trip parAnotherTrip); final void packingChange(); @Override final Trip clone(); @Override final String toString();  }
@Test public void testDeleteItem() throws Exception { mTestTrip.addItem(NEW_ITEM_NAME); TripItem delItem = mTestTrip.addItem(NEW_ITEM2_NAME); mTestTrip.addItem(NEW_ITEM3_NAME); mTestTrip.addItem(NEW_ITEM4_NAME); assertTrue(mTestTrip.getListOfItems().size()==4); mTestTrip.deleteItem(delItem.getUUID()); }