@Override
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
int len = in.readInt();
Class elemCl = in.getClassForName( in.readStringUTF() );
EnumSet enSet = EnumSet.noneOf(elemCl);
in.registerObject(enSet,streamPositioin,serializationInfo, referencee); // IMPORTANT, else tracking double objects will fail
for (int i = 0; i < len; i++) {
String val = in.readStringUTF();
enSet.add(Enum.valueOf(elemCl,val));
}
return enSet;
}