please include function getThoughtSpace. static ThoughtSpace getOrAddThoughtSpace(S globalID) { ThoughtSpace ts = getThoughtSpace_map.get(globalID); if (ts == null) addThoughtSpace(ts = new ThoughtSpace(globalID)); ret ts; }