SymbolFactoryImpl implements SymbolFactory { @Override public JavaSymbolImpl createJavaSymbol(Object value) { JavaSymbolImpl sym = findJavaSymbol(value); if(sym == null) { sym = new JavaSymbolImpl(this, get_next_hash_id(), value); javaSyms.put(value, sym); } return sym; } SymbolFactoryImpl(); VariableGenerator getVariableGenerator(); List<Symbol> getAllSymbols(); @SuppressWarnings("unchecked") List<T> getSymbols(Class<T> klass); void reset(); void reset_id_and_variable_tc_numbers(); void reset_variable_gensym_numbers(); void resetIdNumber(char name_letter, long letter_max); long getIdNumber(char name_letter); long incrementIdNumber(char name_letter); Variable find_variable(String name); Variable make_variable(String name); IdentifierImpl findIdentifier(char name_letter, long name_number); boolean findAndNullIdentifier(IdentifierImpl identifier); IdentifierImpl make_new_identifier(char name_letter, int /*goal_stack_level*/ level); IdentifierImpl make_new_identifier(char name_letter, long name_number, int /*goal_stack_level*/ level); IdentifierImpl createIdentifier(char name_letter); @Override IdentifierImpl findOrCreateIdentifier(char nameLetter, long nameNumber); IdentifierImpl findOrCreateIdentifierExact(char nameLetter, long nameNumber); StringSymbolImpl findString(String name); StringSymbolImpl createString(String name); StringSymbol generateUniqueString(String prefix, ByRef<Integer> number); IntegerSymbolImpl createInteger(long value); IntegerSymbolImpl findInteger(long value); DoubleSymbolImpl createDouble(double value); DoubleSymbolImpl findDouble(double value); @Override JavaSymbolImpl createJavaSymbol(Object value); @Override JavaSymbolImpl findJavaSymbol(Object value); @Override Symbol importSymbol(Symbol s);  }
@Test public void testCreateJavaSymbol() { File f = new File(System.getProperty("user.dir")); JavaSymbol js = syms.findJavaSymbol(f); assertNull(js); js = syms.createJavaSymbol(f); assertNotNull(js); assertEquals(f, js.getValue()); }