Trip implements Serializable, Comparable<Trip>, Cloneable { @Override public final Trip clone() throws CloneNotSupportedException { Trip clonedTrip = (Trip) super.clone(); clonedTrip.mUUID = UUID.randomUUID(); clonedTrip.mListItem = new ArrayList<>(); for (int i = 0; i < mListItem.size(); i++) { clonedTrip.addItem(mListItem.get(i).clone()); } return clonedTrip; } 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 testClone() throws Exception { mTestTrip.addItem(NEW_ITEM_NAME); mTestTrip.addItem(NEW_ITEM2_NAME); Trip clonedTrip = mTestTrip.clone(); assertTrue(mTestTrip.getNote().contentEquals(clonedTrip.getNote())); assertTrue(mTestTrip.getStartDate()==clonedTrip.getStartDate()); assertTrue(mTestTrip.getEndDate()==clonedTrip.getEndDate()); assertTrue(mTestTrip.getListOfItems().size()==clonedTrip.getListOfItems().size()); assertTrue(mTestTrip.getListOfItems().get(0).getUUID() != clonedTrip.getListOfItems().get(0).getUUID()); assertNotNull(mTestTrip.getName()); assertNotNull(clonedTrip.getName()); assertTrue(mTestTrip.getName().contentEquals(clonedTrip.getName())); assertTrue(mTestTrip.getUUID()!=clonedTrip.getUUID()); }