Transaction implements Comparable<Transaction> { public Transaction withId(String id) { return new Transaction(id, date, description, amount, categoryName, category, accountNumber); } Transaction(Date date, String description, long amount, Category category, String accountNumber); private  Transaction(String id, Date date, String description, long amount, String categoryName, Category category,
			String accountNumber); String getId(); Date getDate(); String getDescription(); long getAmount(); String getAccountNumber(); Category getCategory(); String getCategoryName(); Transaction withCategory(Category category); Transaction withCategoryName(String categoryName); Transaction withId(String id); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Transaction o); @Override String toString();  }
@Test public void withId() { Transaction transaction1 = new Transaction(new Date(), "a desc", 1003, null, "acct1"); Transaction transaction2 = transaction1.withId("test12345"); assertNotNull(transaction2); assertNotSame(transaction1, transaction2); assertEquals("test12345", transaction2.getId()); assertEquals(transaction1, transaction2); }