@Test public void duplicate() { final int id = 17; final int typeID = 42; final EntityMessage message = MessageTestUtil.createMessage( id, typeID, 0, "r1", "r2", "a1", "a2" ); final Change change = new Change( message ); change.getChannels().put( 1, 1 ); change.getChannels().put( 2, 3 ); final Change duplicate = change.duplicate(); assertEquals( duplicate.getKey(), change.getKey() ); assertEquals( duplicate.getEntityMessage().getId(), change.getEntityMessage().getId() ); assertNotSame( duplicate.getEntityMessage(), change.getEntityMessage() ); assertEquals( duplicate.getChannels(), change.getChannels() ); assertNotSame( duplicate.getChannels(), change.getChannels() ); }
@Nonnull public Change duplicate() { final Change change = new Change( getEntityMessage().duplicate() ); change.getChannels().putAll( getChannels() ); return change; }
Change { @Nonnull public Change duplicate() { final Change change = new Change( getEntityMessage().duplicate() ); change.getChannels().putAll( getChannels() ); return change; } }
Change { @Nonnull public Change duplicate() { final Change change = new Change( getEntityMessage().duplicate() ); change.getChannels().putAll( getChannels() ); return change; } Change( @Nonnull final EntityMessage entityMessage );  Change( @Nonnull final EntityMessage entityMessage,
                 final int channelId,
                 @Nullable final Integer subChannelId ); }
Change { @Nonnull public Change duplicate() { final Change change = new Change( getEntityMessage().duplicate() ); change.getChannels().putAll( getChannels() ); return change; } Change( @Nonnull final EntityMessage entityMessage );  Change( @Nonnull final EntityMessage entityMessage,
                 final int channelId,
                 @Nullable final Integer subChannelId ); @Nonnull String getKey(); @Nonnull EntityMessage getEntityMessage(); @Nonnull Map<Integer, Integer> getChannels(); void merge( @Nonnull final Change other ); @Nonnull Change duplicate(); }
Change { @Nonnull public Change duplicate() { final Change change = new Change( getEntityMessage().duplicate() ); change.getChannels().putAll( getChannels() ); return change; } Change( @Nonnull final EntityMessage entityMessage );  Change( @Nonnull final EntityMessage entityMessage,
                 final int channelId,
                 @Nullable final Integer subChannelId ); @Nonnull String getKey(); @Nonnull EntityMessage getEntityMessage(); @Nonnull Map<Integer, Integer> getChannels(); void merge( @Nonnull final Change other ); @Nonnull Change duplicate();  }