IgIndexResponseParser { public static InstrumentInfo createInstrumentInfo(String json) throws IOException { checkNotNull(json); JsonNode jsonNode = checkNotNull((new ObjectMapper()).readTree(json)); JsonNode instrumentNode = checkNotNull(jsonNode.get(TAG_INSTRUMENT)); String instrumentId = getInstrumentIdByEpic(instrumentNode.get(TAG_EPIC).asText()); String instrumentName = instrumentNode.get(TAG_NAME).asText(); InstrumentType instrumentType = getInstrumentTypeByText(instrumentNode.get(TAG_TYPE).asText()); String expiry = checkNotNullOrEmpty(instrumentNode.get(TAG_EXPIRY).asText()); JsonNode snapshotNode = checkNotNull(jsonNode.get(TAG_SNAPSHOT)); int scalingFactor = snapshotNode.get(TAG_SCALING_FACTOR).asInt(); return new InstrumentInfo(instrumentId, instrumentName, instrumentType, scalingFactor, expiry); }  static IgIndexConnectionCredentials createConnectionCredentials(
      String apiKey, HttpClientResponse httpClientResponse); static List<InstrumentInfo> createInstrumentInfoList(String json); static InstrumentInfo createInstrumentInfo(String json);  }
@Test public void testCreateInstrumentInfo() throws IOException { InputStream fileMarketEpicResponse = ClassLoader.getSystemResourceAsStream(FILE_MARKET_EPIC_RESPONSE); InstrumentInfo instrumentInfo = IgIndexResponseParser.createInstrumentInfo(IOUtils.toString(fileMarketEpicResponse)); fileMarketEpicResponse.close(); assertInstrumentInfo(instrumentInfo); }