### Question:
Token implements StripePaymentSource { @Nullable public static Token fromString(@Nullable String jsonString) { try { JSONObject tokenObject = new JSONObject(jsonString); return fromJson(tokenObject); } catch (JSONException exception) { return null; } } Token(
            String id,
            boolean livemode,
            Date created,
            Boolean used,
            Card card);  Token(
            String id,
            boolean livemode,
            Date created,
            Boolean used,
            BankAccount bankAccount);  Token(
            String id,
            boolean livemode,
            Date created,
            Boolean used
    ); Date getCreated(); @Override String getId(); boolean getLivemode(); boolean getUsed(); @TokenType String getType(); Card getCard(); BankAccount getBankAccount(); @Nullable static Token fromString(@Nullable String jsonString); @Nullable static Token fromJson(@Nullable JSONObject jsonObject); static final String TYPE_CARD; static final String TYPE_BANK_ACCOUNT; static final String TYPE_PII; }### Answer:
@Test public void parseToken_withoutId_returnsNull() { Token token = Token.fromString(RAW_TOKEN_NO_ID); assertNull(token); }
@Test public void parseToken_withoutType_returnsNull() { Token token = Token.fromString(RAW_BANK_TOKEN_NO_TYPE); assertNull(token); }