### Question:
MouseAwt implements Mouse { @Override public void doClick(int click) { clicker.robotPress(click); release = click; } MouseAwt(); void setResolution(Resolution output, Resolution source); MouseListener getClicker(); MouseMotionListener getMover(); @Override void addActionPressed(int click, EventAction action); @Override void addActionReleased(int click, EventAction action); @Override void lock(); @Override void lock(int x, int y); @Override void doClick(int click); @Override void doSetMouse(int x, int y); @Override void doMoveMouse(int x, int y); @Override void doClickAt(int click, int x, int y); @Override void setCenter(int x, int y); @Override int getOnScreenX(); @Override int getOnScreenY(); @Override int getX(); @Override int getY(); @Override int getMoveX(); @Override int getMoveY(); @Override int getClick(); @Override boolean hasClicked(int click); @Override boolean hasClickedOnce(int click); @Override boolean hasMoved(); @Override void update(double extrp); static final int LEFT; static final int MIDDLE; static final int RIGHT; }### Answer:
@Test void testDoClick() { final MouseAwt mouse = createMouse(); final MouseMotionListener mover = mouse.getMover(); assertFalse(mouse.hasClicked(MouseAwt.RIGHT)); mover.mouseMoved(createEvent(MouseAwt.LEFT, 0, 0)); mouse.doClickAt(MouseAwt.RIGHT, 500, 500); mouse.update(1.0); try { assertEquals(500, mouse.getOnScreenX()); assertEquals(500, mouse.getOnScreenY()); assertTrue(mouse.hasClicked(MouseAwt.RIGHT)); } finally { mouse.doClickAt(MouseAwt.LEFT, 499, 499); } assertTrue(mouse.hasClicked(MouseAwt.LEFT)); mouse.doClick(MouseAwt.LEFT); assertTrue(mouse.hasClicked(MouseAwt.LEFT)); mouse.update(1.0); mouse.doClick(MouseAwt.MIDDLE); mouse.update(1.0); mouse.doSetMouse(1, 2); assertEquals(1, mouse.getOnScreenX()); assertEquals(2, mouse.getOnScreenY()); mouse.doMoveMouse(3, 4); assertEquals(3, mouse.getOnScreenX()); assertEquals(4, mouse.getOnScreenY()); mouse.lock(); mouse.lock(500, 500); }