ListSeparator (ItemWrapper value) { if (value.addSeparatorAbove()) return new ListSeparator(); final List<ItemWrapper> configurations = getValues(); final int index = configurations.indexOf(value); if (index > 0 && index <= configurations.size() - 1) { final ItemWrapper aboveConfiguration = configurations.get(index - 1); if (aboveConfiguration != null && aboveConfiguration.isDynamic() != value.isDynamic()) { return new ListSeparator(); } final ConfigurationType currentType = value.getType(); final ConfigurationType aboveType = aboveConfiguration == null ? null : aboveConfiguration.getType(); if (aboveType != currentType && currentType != null) { return new ListSeparator(); // new ListSeparator(currentType.getDisplayName()); } } return null; }