### Question:
BuilderFactory { public List<GeometryBuilder> createBuilders(PlatformMetadata model) { List<GeometryBuilder> builders = New.list(); if (model instanceof PlatformMetadataAndImage) { builders.add(myImageBuilder); } else { builders.add(myFootprintBuilder); builders.add(myVehicleBuilder); } return builders; } BuilderFactory(OrderManagerRegistry orderRegistry, MapContext<? extends Viewer> mapManager); List<Geometry> close(); List<GeometryBuilder> createBuilders(PlatformMetadata model);  }### Answer:
@Test public void testMetadata() { EasyMockSupport support = new EasyMockSupport(); OrderManagerRegistry orderRegistry = support.createMock(OrderManagerRegistry.class); @SuppressWarnings("unchecked") MapContext<? extends Viewer> mapManager = support.createMock(MapContext.class); PlatformMetadata metadata = new PlatformMetadata(); support.replayAll(); BuilderFactory factory = new BuilderFactory(orderRegistry, mapManager); List<GeometryBuilder> builders = factory.createBuilders(metadata); assertEquals(2, builders.size()); assertTrue(builders.get(0) instanceof FootprintGeometryBuilder); assertTrue(builders.get(1) instanceof PlatformGeometryBuilder); support.verifyAll(); }
@Test public void testMetadataImage() { EasyMockSupport support = new EasyMockSupport(); OrderManagerRegistry orderRegistry = support.createMock(OrderManagerRegistry.class); @SuppressWarnings("unchecked") MapContext<? extends Viewer> mapManager = support.createMock(MapContext.class); PlatformMetadata justMetadata = new PlatformMetadata(); PlatformMetadataAndImage metadata = new PlatformMetadataAndImage(justMetadata, ByteBuffer.wrap(new byte[] { 1, 2, 3 })); support.replayAll(); BuilderFactory factory = new BuilderFactory(orderRegistry, mapManager); List<GeometryBuilder> builders = factory.createBuilders(metadata); assertEquals(1, builders.size()); assertTrue(builders.get(0) instanceof ImageGeometryBuilder); support.verifyAll(); }