ListData (@NotNull ListData list) { ListData listWithSameName = getDataByName(list.name); if (listWithSameName != null) { LOG.error(String.format("Attempt to create changelist with same name: %s - %s", list.name, list.id)); return listWithSameName; } ListData listWithSameId = getDataById(list.id); if (listWithSameId != null) { LOG.error(String.format("Attempt to create changelist with same id: %s - %s", list.name, list.id)); return listWithSameId; } myLists.add(list); return list; }