OtpErlangObject value = null;
if (outcome.getClass().equals(Boolean.class))
value = new OtpErlangBoolean(
((Boolean) outcome).booleanValue());
else if (outcome.getClass().equals(Double.class))
value = new OtpErlangDouble(
((Double) outcome).doubleValue());
else if (outcome.getClass().equals(String.class))
value = new OtpErlangAtom((String) outcome);
else if (outcome.getClass().equals(Integer.class))
value = new OtpErlangInt(((Integer) outcome).intValue());