Hello Amith,
Do you mean that the getItem method was implemented by your developers? If so, you should refer to its declaration to check what type of value it returns. The SWT ToolBar widget's getItem method returns a ToolItem object that can be operated fine in a test script.