### Question:
DataStoreMetadata { public Set<Partition> getAllPartitions() { Set<Partition> partitions = new HashSet<Partition>(); for (Map.Entry<String, String> entry : getAllValuesByType(PARTITION_NAMESPACE, NAME_KEY).entrySet()) { partitions.add(new Partition(Integer.parseInt(entry.getValue()), entry.getKey())); } return partitions; } DataStoreMetadata(RDBMSDataStore dataStore); Map<String, String> getAllValuesByType(String namespace, String type); Partition getPartition(String name); Partition getNewPartition(); Set<Partition> getAllPartitions(); void removePartition(Partition partition); static final String METADATA_TABLENAME; static final String ANONYMOUS_PARTITION_PREFIX; static final String PARTITION_NAMESPACE; static final String NAME_KEY; }### Answer:
@Test public void testGetAllPartitions() { DataStoreMetadata metadata = ((RDBMSDataStore)model.dataStore).getMetadata(); Map<String, String> actual = metadata.getAllValuesByType(DataStoreMetadata.PARTITION_NAMESPACE, DataStoreMetadata.NAME_KEY); Map<String, String> expected = new HashMap<String, String>(); expected.put(TestModel.PARTITION_OBSERVATIONS, "1"); expected.put(TestModel.PARTITION_TARGETS, "2"); expected.put(TestModel.PARTITION_TRUTH, "3"); assertEquals(expected, actual); }