### Question:
AgnosticPolygonPanel implements PolygonPanel { @Override public void centerOn(Coordinate coordinate) { int xCenter = panel.getWidth() / 2; int yCenter = panel.getHeight() / 2; int newCenterX = xCenter - coordinate.x; int newCenterY = yCenter - coordinate.y; transform.preconcatenate(new Translation(newCenterX, newCenterY)); updateDisplayTransformation(); } AgnosticPolygonPanel(DisplayPolygonPanel polygonPanel); @Override void refresh(); @Override SpecialControlTrigger addSpecialControl(); @Override void add(InteractiveGraphicsElement element); @Override void add(GraphicsElement element); @Override void scale(double scale); @Override void scaleToPoint(double scale, Coordinate coordinate); @Override void translate(int x, int y); @Override void translateRelativeToScale(int x, int y); @Override void resetTransformation(); @Override void changeCursor(Coordinate coordinate); @Override void clear(); @Override Executor onElementAtPoint(Coordinate coordinate); @Override void centerOn(Coordinate coordinate); @Override void addMousePressListener(final MousePressClosure listener); @Override void addMouseClickListener(final MouseClickClosure listener); @Override void addMouseWheelListener(final MouseWheelClosure listener); @Override void setToolTipText(String toolTip); @Override void addMouseMotionListener(final MouseMotionClosure listener); @Override void setBackground(RGBColor color); @Override void showMoveCursor(); @Override StatefulTooltip createToolTip();  }### Answer:
@Test public void centersOnGivenCoordinate() throws Exception { DisplayPolygonPanel displayPanel = mock(DisplayPolygonPanel.class); AgnosticPolygonPanel polygonPanel = new AgnosticPolygonPanel(displayPanel); polygonPanel.centerOn(new Coordinate(2, 3)); AgnosticTransform expected = new AgnosticTransform(); expected.preconcatenate(new Translation(-2, -3)); verify(displayPanel).setTransformation(expected); }