public enum Brand {VISA, MASTERCARD} public enum EReplacePrepaidCardReason {LOST_STOLEN, DAMAGED, COMPROMISED, EXPIRED, VIRTUAL_TO_PHYSICAL} public enum Type {PREPAID_CARD} public static class ForeignExchange {

    private Double sourceAmount;
    private String sourceCurrency;
    private Double destinationAmount;
    private String destinationCurrency;
    private Double rate;

    public Double getSourceAmount() {
        return sourceAmount;
    }

    public void setSourceAmount(Double sourceAmount) {
        this.sourceAmount = sourceAmount;
    }

    public String getSourceCurrency() {
        return sourceCurrency;
    }

    public void setSourceCurrency(String sourceCurrency) {
        this.sourceCurrency = sourceCurrency;
    }

    public Double getDestinationAmount() {
        return destinationAmount;
    }

    public void setDestinationAmount(Double destinationAmount) {
        this.destinationAmount = destinationAmount;
    }

    public String getDestinationCurrency() {
        return destinationCurrency;
    }

    public void setDestinationCurrency(String destinationCurrency) {
        this.destinationCurrency = destinationCurrency;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }
} public enum CardType {PERSONALIZED, INSTANT_ISSUE, VIRTUAL} public enum VerificationStatus {EXPIRED, FAILED, UNDER_REVIEW, VERIFIED, REQUIRED, NOT_REQUIRED, READY_FOR_REVIEW, REQUESTED} public static enum Gender {MALE, FEMALE} public static enum GovernmentIdType {PASSPORT, NATIONAL_ID_CARD} public static enum ProfileType {INDIVIDUAL, BUSINESS, UNKNOWN} public enum TaxVerificationStatus {NOT_REQUIRED, REQUIRED, UNDER_REVIEW, VERIFIED} public enum RejectReason {
    DOCUMENT_EXPIRED,
    DOCUMENT_NOT_RELATED_TO_PROFILE,
    DOCUMENT_NOT_READABLE,
    DOCUMENT_NOT_DECISIVE,
    DOCUMENT_NOT_COMPLETE,
    DOCUMENT_CORRECTION_REQUIRED,
    DOCUMENT_NOT_VALID_WITH_NOTES,
    DOCUMENT_TYPE_NOT_VALID;
} public class Multipart {

    List<MultipartData> multipartList;

    public List<MultipartData> getMultipartList() {
        return multipartList;
    }

    public void setMultipartList(List<MultipartData> multipartList) {
        this.multipartList = multipartList;
    }

    public void add(MultipartData multipartData) {
        if (multipartList == null) {
            multipartList = new ArrayList<MultipartData>();
        }
        multipartList.add(multipartData);
    }

    public static class MultipartData {
        private final String contentType; //json, img
        private final Map<String, String> entity; //name, content
        private final String contentDisposition;

        MultipartData(String contentType, String contentDisposition, Map<String, String> entity){
            this.contentType = contentType;
            this.contentDisposition = contentDisposition;
            this.entity = entity;
        }
        public String getContentType() {
            return contentType;
        }

        public String getContentDisposition() {
            return contentDisposition;
        }

        public Map<String, String> getEntity() {
            return entity;
        }

    }
} public enum Status {
    PRE_ACTIVATED, ACTIVATED, DE_ACTIVATED, FROZEN, SUSPENDED, UNSUSPENDED, LOST_OR_STOLEN, LOCKED, UNLOCKED,
    CREATED, SCHEDULED, PENDING_ACCOUNT_ACTIVATION, PENDING_ID_VERIFICATION, PENDING_TAX_VERIFICATION,
    PENDING_TRANSFER_METHOD_ACTION, PENDING_TRANSACTION_VERIFICATION, IN_PROGRESS, COMPLETED, FAILED,
    RECALLED, RETURNED, EXPIRED, CANCELLED, VERIFIED, INVALID, QUOTED, VERIFICATION_REQUIRED

}
import com.hyperwallet.clientsdk.model.*;
import com.hyperwallet.clientsdk.model.HyperwalletPrepaidCard.Brand;
import com.hyperwallet.clientsdk.model.HyperwalletPrepaidCard.EReplacePrepaidCardReason;
import com.hyperwallet.clientsdk.model.HyperwalletPrepaidCard.Type;
import com.hyperwallet.clientsdk.model.HyperwalletTransfer.ForeignExchange;
import com.hyperwallet.clientsdk.model.HyperwalletTransferMethod.CardType;
import com.hyperwallet.clientsdk.model.HyperwalletTransferMethod.VerificationStatus;
import com.hyperwallet.clientsdk.model.HyperwalletUser.Gender;
import com.hyperwallet.clientsdk.model.HyperwalletUser.GovernmentIdType;
import com.hyperwallet.clientsdk.model.HyperwalletUser.ProfileType;
import com.hyperwallet.clientsdk.model.HyperwalletUser.TaxVerificationStatus;
import com.hyperwallet.clientsdk.model.HyperwalletVerificationDocumentReason.RejectReason;
import com.hyperwallet.clientsdk.util.Multipart;
import org.apache.commons.io.IOUtils;
import org.mockserver.integration.ClientAndServer;
import org.mockserver.model.HttpRequest;
import org.mockserver.model.HttpResponse;
import org.mockserver.model.HttpStatusCode;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.hyperwallet.clientsdk.model.HyperwalletStatusTransition.Status.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.mockserver.integration.ClientAndServer.startClientAndServer;
import static org.mockserver.model.Header.header;
import static org.mockserver.model.JsonBody.json;
import static org.testng.Assert.*;
        try {
            returnValue = client.createPaperCheckStatusTransition("usr-1dea80c9-c73e-4490-91b7-097d4a07550f",
                    "trm-9e2e1a06-a33b-4c2f-9933-893ae21db442",
                    transition);
        } catch (Exception e) {
            mockServer.verify(parseRequest(functionality));
            throw e;
        }

        List<HyperwalletLink> hyperwalletLinks = new ArrayList<>();
        HyperwalletLink hyperwalletLink = new HyperwalletLink();
        hyperwalletLink
                .setHref("https://api.sandbox.hyperwallet.com/rest/v4/users/usr-1dea80c9-c73e-4490-91b7-097d4a07550f/paper-checks/trm-9e2e1a06"
                        + "-a33b-4c2f-9933-893ae21db442/status-transitions/sts-ed2207f0-39cc-493f-9cd0-24998de0c0f7");
        Map<String, String> mapParams = new HashMap<>();
        mapParams.put("rel", "self");
        hyperwalletLink.setParams(mapParams);
        hyperwalletLinks.add(hyperwalletLink);

        assertThat(returnValue.getToken(), is(equalTo("sts-ed2207f0-39cc-493f-9cd0-24998de0c0f7")));
        assertThat(returnValue.getCreatedOn(), is(equalTo(dateFormat.parse("2017-10-30T19:50:49 UTC"))));
        assertThat(returnValue.getTransition(), is(equalTo(DE_ACTIVATED)));
        assertThat(returnValue.getFromStatus(), is(equalTo(ACTIVATED)));
        assertThat(returnValue.getToStatus(), is(equalTo(DE_ACTIVATED)));
        assertThat(returnValue.getNotes(), is(equalTo("Closing check.")));

        HyperwalletLink actualHyperwalletLink = returnValue.getLinks().get(0);
        HyperwalletLink expectedHyperwalletLink = hyperwalletLinks.get(0);
        assertThat(actualHyperwalletLink.getHref(), is(equalTo(expectedHyperwalletLink.getHref())));
        assertThat(actualHyperwalletLink.getParams(), is(expectedHyperwalletLink.getParams()));
    }

    @Test
    public void testGetPaperCheckStatusTransition() throws Exception {
        String functionality = "getPaperCheckStatusTransition";
        initMockServer(functionality);

        HyperwalletStatusTransition transition = new HyperwalletStatusTransition();
        transition.setNotes("Closing this account.");
        transition.setTransition(DE_ACTIVATED);

        HyperwalletStatusTransition returnValue;
        try {
            returnValue = client.getPaperCheckStatusTransition("usr-1dea80c9-c73e-4490-91b7-097d4a07550f",
                    "trm-9e2e1a06-a33b-4c2f-9933-893ae21db442",
                    "sts-ed2207f0-39cc-493f-9cd0-24998de0c0f7");
        } catch (Exception e) {
            mockServer.verify(parseRequest(functionality));
            throw e;
        }

        List<HyperwalletLink> hyperwalletLinks = new ArrayList<>();
        HyperwalletLink hyperwalletLink = new HyperwalletLink();
        hyperwalletLink
                .setHref("https://api.sandbox.hyperwallet.com/rest/v4/users/usr-1dea80c9-c73e-4490-91b7-097d4a07550f/paper-checks/trm-9e2e1a06"
                        + "-a33b-4c2f-9933-893ae21db442/status-transitions/sts-ed2207f0-39cc-493f-9cd0-24998de0c0f7");
        Map<String, String> mapParams = new HashMap<>();
        mapParams.put("rel", "self");
        hyperwalletLink.setParams(mapParams);
        hyperwalletLinks.add(hyperwalletLink);

        assertThat(returnValue.getToken(), is(equalTo("sts-ed2207f0-39cc-493f-9cd0-24998de0c0f7")));
        assertThat(returnValue.getCreatedOn(), is(equalTo(dateFormat.parse("2017-10-30T19:50:49 UTC"))));
        assertThat(returnValue.getTransition(), is(equalTo(DE_ACTIVATED)));
        assertThat(returnValue.getFromStatus(), is(equalTo(ACTIVATED)));
        assertThat(returnValue.getToStatus(), is(equalTo(DE_ACTIVATED)));
        assertThat(returnValue.getNotes(), is(equalTo("Closing check.")));

        HyperwalletLink actualHyperwalletLink = returnValue.getLinks().get(0);
        HyperwalletLink expectedHyperwalletLink = hyperwalletLinks.get(0);
        assertThat(actualHyperwalletLink.getHref(), is(equalTo(expectedHyperwalletLink.getHref())));
        assertThat(actualHyperwalletLink.getParams(), is(expectedHyperwalletLink.getParams()));
    }

    //
    // Transfers
    //
    @Test
    public void testCreateTransfer() throws Exception {
        String functionality = "createTransfer";
        initMockServer(functionality);

        HyperwalletTransfer transfer = new HyperwalletTransfer()
                .sourceToken("usr-c4292f1a-866f-4310-a289-b916853939de")
                .destinationToken("trm-ff53d939-49c3-412f-8d83-ab4f7e83d553")
                .clientTransferId("clientTransferId");

        HyperwalletTransfer returnValue;
        try {
            returnValue = client.createTransfer(transfer);
        } catch (Exception e) {
            mockServer.verify(parseRequest(functionality));
            throw e;
        }

        List<HyperwalletLink> hyperwalletLinks = new ArrayList<>();
        HyperwalletLink hyperwalletLink = new HyperwalletLink();
        hyperwalletLink.setHref(
                "https://api.sandbox.hyperwallet.com/rest/v4/transfers/trf-59f67c62-fd06-497e-a9ea-99d6eb38b12b");
        Map<String, String> mapParams = new HashMap<>();
        mapParams.put("rel", "self");
        hyperwalletLink.setParams(mapParams);
        hyperwalletLinks.add(hyperwalletLink);

        assertThat(returnValue.getToken(), is(equalTo("trm-59f67c62-fd06-497e-a9ea-99d6eb38b12b")));
        assertThat(returnValue.getStatus(), is(equalTo(HyperwalletTransfer.Status.QUOTED)));
        assertThat(returnValue.getCreatedOn(), is(equalTo(dateFormat.parse("2017-10-31T22:32:57 UTC"))));
        assertThat(returnValue.getClientTransferId(), is(equalTo("clientTransferId")));
        assertThat(returnValue.getSourceToken(), is(equalTo("usr-c4292f1a-866f-4310-a289-b916853939de")));
        assertThat(returnValue.getSourceAmount(), is(equalTo("2100.4")));
        assertThat(returnValue.getSourceFeeAmount(), is(equalTo("20.3")));
        assertThat(returnValue.getSourceCurrency(), is(equalTo("USD")));
        assertThat(returnValue.getDestinationToken(), is(equalTo("usr-c4292f1a-866f-4310-a289-b916853939de")));
        assertThat(returnValue.getDestinationAmount(), is(equalTo("2100.2")));
        assertThat(returnValue.getDestinationFeeAmount(), is(equalTo("30.5")));
        assertThat(returnValue.getDestinationCurrency(), is(equalTo("USD")));
        assertThat(returnValue.getNotes(), is(equalTo("notes")));
        assertThat(returnValue.getMemo(), is(equalTo("memo")));
        assertThat(returnValue.getExpiresOn(), is(equalTo(dateFormat.parse("2017-10-31T22:32:57 UTC"))));

        ForeignExchange foreignExchange = returnValue.getForeignExchanges().get(0);