### Question:
DataTypeConfigCompare { public CompareResult run(Configuration left, Configuration right) { SortedSet<String> same = new TreeSet<>(); SortedSet<String> diff = new TreeSet<>(); SortedSet<String> leftOnly = new TreeSet<>(); SortedSet<String> rightOnly = new TreeSet<>(); String leftPrefix = getPrefix(left); String rightPrefix = getPrefix(right); for (Map.Entry<String,String> entry : left) { ConfField field = new ConfField(leftPrefix, entry.getKey()); String leftValue = entry.getValue(); String rightValue = right.get(field.getField(rightPrefix)); if (nullSafeEquals(leftValue, rightValue)) { same.add(field.getField()); } else if (rightValue == null) { leftOnly.add(field.getField()); } else { diff.add(field.getField()); } } for (Map.Entry<String,String> entry : right) { ConfField field = new ConfField(rightPrefix, entry.getKey()); if (left.get(field.getField(leftPrefix)) == null) { rightOnly.add(field.getField()); } } return new CompareResult(same, diff, leftOnly, rightOnly); }  CompareResult run(Configuration left, Configuration right); static final String PREFIX; }### Answer:
@Test public void shouldDetectSameSettings() { CompareResult result = compare.run(type1Conf, type2Conf); assertTrue(result.getSame().contains("file.input.format")); assertTrue(result.getSame().contains("handler.classes")); }
@Test public void shouldDetectDifferentSettings() { CompareResult result = compare.run(type1Conf, type2Conf); assertTrue(result.getDiff().contains("ingest.helper.class")); }
@Test public void shouldDetectLeftOnlySettings() { CompareResult result = compare.run(type1Conf, type2Conf); assertTrue(result.getLeftOnly().contains("only.type1.value")); }
@Test public void shouldDetectRightOnlySettings() { CompareResult result = compare.run(type1Conf, type2Conf); assertTrue(result.getRightOnly().contains("only.type2.value")); }