### Question:
NiftyMouseImpl implements NiftyMouse { @Override public void registerMouseCursor( @Nonnull final String id, @Nonnull final String filename, final int hotspotX, final int hotspotY) throws IOException { MouseCursor mouseCursor = renderDevice.createMouseCursor(filename, hotspotX, hotspotY); if (mouseCursor == null) { log.warning("Your RenderDevice does not support the createMouseCursor() method. Mouse cursors can't be changed."); return; } registeredMouseCursors.put(id, mouseCursor); } NiftyMouseImpl(
      @Nonnull final RenderDevice renderDevice,
      @Nonnull final InputSystem inputSystem,
      @Nonnull final TimeProvider timeProvider); @Override void registerMouseCursor(
      @Nonnull final String id,
      @Nonnull final String filename,
      final int hotspotX,
      final int hotspotY); @Nullable @Override String getCurrentId(); @Override void unregisterAll(); @Override void resetMouseCursor(); @Override void enableMouseCursor(@Nullable final String id); @Override void setMousePosition(final int x, final int y); @Override int getX(); @Override int getY(); @Override long getNoMouseMovementTime(); void updateMousePosition(final int x, final int y);  }### Answer:
@Test public void testRegisterMouseCursor() throws IOException { expect(renderDeviceMock.createMouseCursor("test", 10, 20)).andReturn(mouseCursor); replay(renderDeviceMock); niftyMouse.registerMouseCursor("id", "test", 10, 20); }
@Test(expected = IOException.class) public void testRegisterMouseCursorIOException() throws IOException { expect(renderDeviceMock.createMouseCursor("test", 10, 20)).andThrow(new IOException("load error")); replay(renderDeviceMock); niftyMouse.registerMouseCursor("id", "test", 10, 20); }