test_class.declarator: examinePlugin
test_class.modifier: @Inject
test_class.original_string: @Inject
  	ExaminePlugin examinePlugin;
test_class.type: ExaminePlugin
test_class.var_name: examinePlugin
test_class.declarator: examineClient
test_class.modifier: @Mock
  	@Bind
test_class.original_string: @Mock
  	@Bind
  	ExamineClient examineClient;
test_class.type: ExamineClient
test_class.var_name: examineClient
test_class.declarator: client
test_class.modifier: @Mock
  	@Bind
test_class.original_string: @Mock
  	@Bind
  	Client client;
test_class.type: Client
test_class.var_name: client
test_class.declarator: chatMessageManager
test_class.modifier: @Mock
  	@Bind
test_class.original_string: @Mock
  	@Bind
  	ChatMessageManager chatMessageManager;
test_class.type: ChatMessageManager
test_class.var_name: chatMessageManager
test_class.declarator: itemManager
test_class.modifier: @Mock
  	@Bind
test_class.original_string: @Mock
  	@Bind
  	ItemManager itemManager;
test_class.type: ItemManager
test_class.var_name: itemManager
test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/examine/ExaminePluginTest.java
test_class.identifier: ExaminePluginTest
test_case.body: @Test
  	public void testGetItemPrice()
  	{
  		ItemComposition itemComposition = mock(ItemComposition.class);
  		when(itemComposition.getName()).thenReturn("Abyssal whip");
  		when(itemComposition.getHaPrice()).thenReturn(2);
  		when(itemManager.getItemPrice(ItemID.ABYSSAL_WHIP)).thenReturn(3);
  		examinePlugin.getItemPrice(ItemID.ABYSSAL_WHIP, itemComposition, 2_000_000_000);
  
  		ArgumentCaptor<QueuedMessage> argumentCaptor = ArgumentCaptor.forClass(QueuedMessage.class);
  		verify(chatMessageManager).queue(argumentCaptor.capture());
  
  		QueuedMessage queuedMessage = argumentCaptor.getValue();
  		assertEquals(
  			"<colNORMAL>Price of <colHIGHLIGHT>2,000,000,000 x Abyssal whip<colNORMAL>:<colNORMAL> GE average <colHIGHLIGHT>6,000,000,000<colNORMAL> (<colHIGHLIGHT>3<colNORMAL>ea)<colNORMAL> HA value <colHIGHLIGHT>4,000,000,000<colNORMAL> (<colHIGHLIGHT>2<colNORMAL>ea)",
  			queuedMessage.getRuneLiteFormattedMessage()
  		);
  	}
test_case.class_method_signature: ExaminePluginTest.testGetItemPrice()
test_case.full_signature: @Test public void testGetItemPrice()
test_case.identifier: testGetItemPrice
test_case.invocations: mock thenReturn when getName thenReturn when getHaPrice thenReturn when getItemPrice getItemPrice forClass queue verify capture getValue assertEquals getRuneLiteFormattedMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetItemPrice()
focal_class.declarator: X_PATTERN = Pattern.compile("^\\d+ x ")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern X_PATTERN = Pattern.compile("^\\d+ x ");
focal_class.type: Pattern
focal_class.var_name: X_PATTERN
focal_class.declarator: pending = new ArrayDeque<>()
focal_class.modifier: private final
focal_class.original_string: private final Deque<PendingExamine> pending = new ArrayDeque<>();
focal_class.type: Deque<PendingExamine>
focal_class.var_name: pending
focal_class.declarator: cache = CacheBuilder.newBuilder()
  		.maximumSize(128L)
  		.build()
focal_class.modifier: private final
focal_class.original_string: private final Cache<CacheKey, Boolean> cache = CacheBuilder.newBuilder()
  		.maximumSize(128L)
  		.build();
focal_class.type: Cache<CacheKey, Boolean>
focal_class.var_name: cache
focal_class.declarator: examineClient
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ExamineClient examineClient;
focal_class.type: ExamineClient
focal_class.var_name: examineClient
focal_class.declarator: client
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private Client client;
focal_class.type: Client
focal_class.var_name: client
focal_class.declarator: itemManager
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ItemManager itemManager;
focal_class.type: ItemManager
focal_class.var_name: itemManager
focal_class.declarator: chatMessageManager
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ChatMessageManager chatMessageManager;
focal_class.type: ChatMessageManager
focal_class.var_name: chatMessageManager
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java
focal_class.identifier: ExaminePlugin
focal_class.class_method_signature: ExaminePlugin.provideExamineClient(OkHttpClient okHttpClient)
focal_class.full_signature: @Provides ExamineClient provideExamineClient(OkHttpClient okHttpClient)
focal_class.identifier: provideExamineClient
focal_class.modifiers: @Provides
focal_class.parameters: (OkHttpClient okHttpClient)
focal_class.return: ExamineClient
focal_class.signature: ExamineClient provideExamineClient(OkHttpClient okHttpClient)
focal_class.class_method_signature: ExaminePlugin.onGameStateChanged(GameStateChanged event)
focal_class.full_signature: @Subscribe public void onGameStateChanged(GameStateChanged event)
focal_class.identifier: onGameStateChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (GameStateChanged event)
focal_class.return: void
focal_class.signature: void onGameStateChanged(GameStateChanged event)
focal_class.class_method_signature: ExaminePlugin.onMenuOptionClicked(MenuOptionClicked event)
focal_class.full_signature: @Subscribe public void onMenuOptionClicked(MenuOptionClicked event)
focal_class.identifier: onMenuOptionClicked
focal_class.modifiers: @Subscribe public
focal_class.parameters: (MenuOptionClicked event)
focal_class.return: void
focal_class.signature: void onMenuOptionClicked(MenuOptionClicked event)
focal_class.class_method_signature: ExaminePlugin.onChatMessage(ChatMessage event)
focal_class.full_signature: @Subscribe public void onChatMessage(ChatMessage event)
focal_class.identifier: onChatMessage
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ChatMessage event)
focal_class.return: void
focal_class.signature: void onChatMessage(ChatMessage event)
focal_class.class_method_signature: ExaminePlugin.findItemFromWidget(int widgetId, int actionParam)
focal_class.full_signature: private int[] findItemFromWidget(int widgetId, int actionParam)
focal_class.identifier: findItemFromWidget
focal_class.modifiers: private
focal_class.parameters: (int widgetId, int actionParam)
focal_class.return: int[]
focal_class.signature: int[] findItemFromWidget(int widgetId, int actionParam)
focal_class.class_method_signature: ExaminePlugin.getItemPrice(int id, ItemComposition itemComposition, int quantity)
focal_class.full_signature: @VisibleForTesting void getItemPrice(int id, ItemComposition itemComposition, int quantity)
focal_class.identifier: getItemPrice
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (int id, ItemComposition itemComposition, int quantity)
focal_class.return: void
focal_class.signature: void getItemPrice(int id, ItemComposition itemComposition, int quantity)
focal_class.class_method_signature: ExaminePlugin.submitExamine(PendingExamine examine, String text)
focal_class.full_signature: private void submitExamine(PendingExamine examine, String text)
focal_class.identifier: submitExamine
focal_class.modifiers: private
focal_class.parameters: (PendingExamine examine, String text)
focal_class.return: void
focal_class.signature: void submitExamine(PendingExamine examine, String text)
focal_class.superclass: extends Plugin
focal_method.body: @VisibleForTesting
  	void getItemPrice(int id, ItemComposition itemComposition, int quantity)
  	{
  		// quantity is at least 1
  		quantity = Math.max(1, quantity);
  		final int gePrice = itemManager.getItemPrice(id);
  		final int alchPrice = itemComposition.getHaPrice();
  
  		if (gePrice > 0 || alchPrice > 0)
  		{
  			final ChatMessageBuilder message = new ChatMessageBuilder()
  				.append(ChatColorType.NORMAL)
  				.append("Price of ")
  				.append(ChatColorType.HIGHLIGHT);
  
  			if (quantity > 1)
  			{
  				message
  					.append(QuantityFormatter.formatNumber(quantity))
  					.append(" x ");
  			}
  
  			message
  				.append(itemComposition.getName())
  				.append(ChatColorType.NORMAL)
  				.append(":");
  
  			if (gePrice > 0)
  			{
  				message
  					.append(ChatColorType.NORMAL)
  					.append(" GE average ")
  					.append(ChatColorType.HIGHLIGHT)
  					.append(QuantityFormatter.formatNumber((long) gePrice * quantity));
  
  				if (quantity > 1)
  				{
  					message
  						.append(ChatColorType.NORMAL)
  						.append(" (")
  						.append(ChatColorType.HIGHLIGHT)
  						.append(QuantityFormatter.formatNumber(gePrice))
  						.append(ChatColorType.NORMAL)
  						.append("ea)");
  				}
  			}
  
  			if (alchPrice > 0)
  			{
  				message
  					.append(ChatColorType.NORMAL)
  					.append(" HA value ")
  					.append(ChatColorType.HIGHLIGHT)
  					.append(QuantityFormatter.formatNumber((long) alchPrice * quantity));
  
  				if (quantity > 1)
  				{
  					message
  						.append(ChatColorType.NORMAL)
  						.append(" (")
  						.append(ChatColorType.HIGHLIGHT)
  						.append(QuantityFormatter.formatNumber(alchPrice))
  						.append(ChatColorType.NORMAL)
  						.append("ea)");
  				}
  			}
  
  			chatMessageManager.queue(QueuedMessage.builder()
  				.type(ChatMessageType.ITEM_EXAMINE)
  				.runeLiteFormattedMessage(message.build())
  				.build());
  		}
  	}
focal_method.class_method_signature: ExaminePlugin.getItemPrice(int id, ItemComposition itemComposition, int quantity)
focal_method.full_signature: @VisibleForTesting void getItemPrice(int id, ItemComposition itemComposition, int quantity)
focal_method.identifier: getItemPrice
focal_method.invocations: max getItemPrice getHaPrice append append append append append formatNumber append append append getName append append append append formatNumber append append append append append append formatNumber append append append append formatNumber append append append append append append formatNumber queue build runeLiteFormattedMessage type builder build
focal_method.modifiers: @VisibleForTesting
focal_method.parameters: (int id, ItemComposition itemComposition, int quantity)
focal_method.return: void
focal_method.signature: void getItemPrice(int id, ItemComposition itemComposition, int quantity)