for (final RemoteItem childItem : childItems) {
childItem.setParent(parentItem);
final RemoteItem existingChildItem = (RemoteItem) parentItem.getChildByName(childItem.getName());
if (existingChildItem != null) {
LOGGER.log(Level.WARNING, "found duplicate: '" + childItem.getPath());
String msg = "";
if (childItem.getRemoteFilesize() != null)
msg += " " + childItem.getRemoteFilesize();
if (existingChildItem.getRemoteFilesize() != null)
msg += " [" + existingChildItem.getRemoteFilesize() + "]";
if (!StringUtils.isEmpty(msg))
LOGGER.log(Level.WARNING, " size: " + msg);
LOGGER.log(Level.WARNING, " created: " + childItem.getRemoteCreationTime() + " [" + existingChildItem.getRemoteCreationTime() + "]");
if (existingChildItem.getRemoteCreationTime().toMillis() > childItem.getRemoteCreationTime().toMillis()) {
parentItem.addChild(childItem);
duplicates.add(existingChildItem);
} else {
duplicates.add(childItem);
}