### Question:
PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return table; } } throw new UnsupportedPartitionTableException(); }  static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice); static synchronized void registerPartitionTable(PartitionTableCreator creator);  }### Answer:
@Test public void testMbrCreate() throws Exception { BlockDeviceDriver blockDevice = new FileBlockDeviceDriver( new URL("https: blockDevice.init(); PartitionTable table = PartitionTableFactory.createPartitionTable(blockDevice); assertTrue(table instanceof MasterBootRecord); }
@Test public void testFileSystemCreate() throws Exception { BlockDeviceDriver blockDevice = new FileBlockDeviceDriver( new URL("https: 2 * 512); blockDevice.init(); PartitionTable table = PartitionTableFactory.createPartitionTable(blockDevice); assertTrue(table instanceof FileSystemPartitionTable); }