CycLFormat extends Format { @Override public Object parseObject(String source, ParsePosition pos) { try { String command = "(multiple-value-list (read-from-string-ignoring-errors (cyclify-string " + DefaultCycObject.stringApiValue(source) + ")))"; CycList ret = (CycList) getCycAccess().converseCycObject(command); Object value = ret.first(); Object indexOrError = ret.second(); if (indexOrError instanceof Integer) { pos.setIndex((Integer) indexOrError); return value; } else { pos.setErrorIndex(pos.getIndex()); return null; } } catch (UnknownHostException ex) { Logger.getLogger(CycLFormat.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(CycLFormat.class.getName()).log(Level.SEVERE, null, ex); } catch (CycApiException ex) { Logger.getLogger(CycLFormat.class.getName()).log(Level.SEVERE, null, ex); } return null; } protected  CycLFormat(CycAccess cyc); static CycLFormat getInstance(CycAccess cyc); void setWrapLines(boolean newlines); void setShowHashDollar(boolean showHashDollar); @Override StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos);  }
@Test public void testParseObject() { System.out.println("testParseObject"); String source = "(#$implies (#$isa ?X #$Cat) (#$likesAsFriend ?X #$CycAdministrator))"; ParsePosition pos = new ParsePosition(0); Object expResult = null; Object result = instance.parseObject(source, pos); assertTrue(result instanceof CycList); }