### Question:
ConvertRecord { public static Map<Integer, PropertyWithValue> convertCustomPropertiesById(List<CSVRecord> records){ Map<Integer, PropertyWithValue> resultPropertiesById = new HashMap<>(); for (CSVRecord record : records){ if(! isValidPropertyRecord(record)){ break; } Integer id = Integer.parseInt(record.get(0)); String property = record.get(1).trim(); String value = record.get(2).trim(); resultPropertiesById.put(id, new PropertyWithValue(property, value)); } return resultPropertiesById; } private  ConvertRecord(); static Map<String, Set<String>> convertCustomProperties(List<CSVRecord> records); static Map<Integer, PropertyWithValue> convertCustomPropertiesById(List<CSVRecord> records); static void fillTodoCustomPropertyInfo(List<Obligation> obligations, List<PropertyWithValueAndId> customProperties, SetMultimap<String, Integer> obligCustomPropertyMap); static Serializer<PropertyWithValueAndId> customPropertiesSerializer(); static List<Obligation> convertTodos(List<CSVRecord> records); static Serializer<Obligation> obligSerializer(); static List<LicenseType> convertLicenseTypes(List<CSVRecord> records); static Serializer<LicenseType> licenseTypeSerializer(); static List<License> fillLicenses(List<CSVRecord> records, Map<Integer, LicenseType> licenseTypeMap, Map<Integer, Obligation> obligMap, Map<String, Set<Integer>> licenseTodo); static Serializer<License> licenseSerializer(); static Map<String, Set<Integer>> convertRelationalTable(List<CSVRecord> records); static Map<Integer, Set<Integer>> convertRelationalTableWithIntegerKeys(List<CSVRecord> records); @NotNull static SetMultimap<String, String> getLicenseToTodoMap(List<License> licenses); static List<List<String>> serialize(List<T> in, Serializer<T> serializer); static List<List<String>> serialize(List<T> in, List<String> headers, Function<T, List<String>> function); @NotNull static List<List<String>> serialize(SetMultimap<T, U> aToB, List<String> headers);  }### Answer:
@Test public void testConvertCustomPropertiesByEmpty() throws Exception { Map<Integer, ConvertRecord.PropertyWithValue> properties = convertCustomPropertiesById(emptyRecord); assertThat(properties.keySet().size(), is(0)); assertThat(properties.values().size(), is(0)); }
@Test public void testConvertCustomPropertiesByIdSmallestPossible() throws Exception { Map<Integer, ConvertRecord.PropertyWithValue> properties = convertCustomPropertiesById(smallestPossibleRecord); assertThat(properties.keySet(), Matchers.containsInAnyOrder(1)); assertThat(properties.get(1).getProperty(), is("prop1")); assertThat(properties.get(1).getValue(), is("val1")); }
@Test public void testConvertCustomPropertiesByIdFull() throws Exception { Map<Integer, ConvertRecord.PropertyWithValue> properties = convertCustomPropertiesById(fullRecord); assertThat(properties.keySet(), Matchers.containsInAnyOrder(1, 2, 3, 4, 5)); assertThat(properties.get(1).getProperty(), is("A")); assertThat(properties.get(1).getValue(), is("A1")); assertThat(properties.get(2).getProperty(), is("A")); assertThat(properties.get(2).getValue(), is("A2")); assertThat(properties.get(3).getProperty(), is("A")); assertThat(properties.get(3).getValue(), is("A3")); assertThat(properties.get(4).getProperty(), is("B")); assertThat(properties.get(4).getValue(), is("B1")); assertThat(properties.get(5).getProperty(), is("B")); assertThat(properties.get(5).getValue(), is("B2")); }