Here you can find the source of addRemoveChangeToString(int from, int to, List> list, List> removed)
public static String addRemoveChangeToString(int from, int to, List<?> list, List<?> removed)
//package com.java2s; /*// w ww . jav a 2 s .c om * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ import java.util.List; public class Main { public static String addRemoveChangeToString(int from, int to, List<?> list, List<?> removed) { StringBuilder b = new StringBuilder(); if (removed.isEmpty()) { b.append(list.subList(from, to)); b.append(" added at ").append(from); } else { b.append(removed); if (from == to) { b.append(" removed at ").append(from); } else { b.append(" replaced by "); b.append(list.subList(from, to)); b.append(" at ").append(from); } } return b.toString(); } }