ClassificationMapper { public List<ClassificationPair> mapPairs(ModsDefinition mods) { List<ClassificationItem> items = map(mods); return toPairs(items); }  List<ClassificationPair> mapPairs(ModsDefinition mods); ModsDefinition mapPairs(ModsDefinition mods, List<ClassificationPair> pairs); List<ClassificationItem> map(ModsDefinition mods); ModsDefinition map(ModsDefinition mods, List<ClassificationItem> items);  }
@Test public void testReadPairs() { ModsDefinition mods = new ModsDefinition(); mods.getClassification().add(classificationType(Type.DDC.getText(), "ddc[0]")); mods.getClassification().add(classificationType(Type.DDC.getText(), "ddc[1]")); mods.getClassification().add(classificationType(Type.UDC.getText(), "udc[2]")); mods.getClassification().add(classificationType(null, "unknown[3]")); mods.getClassification().add(classificationType(Type.UDC.getText(), "udc[4]")); ClassificationMapper instance = new ClassificationMapper(); List<ClassificationPair> expResult = Arrays.asList( new ClassificationPair("ddc[0]", 0, null, null), new ClassificationPair("ddc[1]", 1, "udc[2]", 2), new ClassificationPair(null, null, "udc[4]", 4) ); List<ClassificationPair> result = instance.mapPairs(mods); assertThat(result, Is.is(expResult)); }