### Question:
PaymentMethodService { public static PaymentMethod update(final Context context, final String number, final PaymentMethod paymentMethod) throws NetLicensingException { CheckUtils.paramNotEmpty(number, "number"); CheckUtils.paramNotNull(paymentMethod, "paymentMethod"); return NetLicensingService.getInstance().post(context, Constants.PaymentMethod.ENDPOINT_PATH + "/" + number, paymentMethod.asRequestForm(), PaymentMethod.class); }  static PaymentMethod get(final Context context, final String number); static Page<PaymentMethod> list(final Context context, final String filter); static PaymentMethod update(final Context context, final String number, final PaymentMethod paymentMethod);  }### Answer:
@Test public void testUpdate() throws Exception { final PaymentMethod paymentMethod = new PaymentMethodImpl(); paymentMethod.setActive(false); paymentMethod.addProperty(PAYMENT_METHOD_CUSTOM_PROPERTY, "new_sample_paypal_subject"); paymentMethod.addProperty(PAYMENT_METHOD_DELETING_PROPERTY, ""); final PaymentMethod updatedPaymentMethod = PaymentMethodService.update(context, "PAYPAL", paymentMethod); assertNotNull(updatedPaymentMethod); assertEquals(false, updatedPaymentMethod.getActive()); assertEquals("new_sample_paypal_subject", updatedPaymentMethod.getProperties().get(PAYMENT_METHOD_CUSTOM_PROPERTY)); assertNull(updatedPaymentMethod.getProperties().get(PAYMENT_METHOD_DELETING_PROPERTY)); }
@Test public void testUpdateWithNumber() throws Exception { final PaymentMethod paymentMethod = new PaymentMethodImpl(); paymentMethod.setNumber("PAYPAL_NEW"); thrown.expect(ServiceException.class); thrown.expectMessage("MalformedRequestException: Requested payment method is not supported"); PaymentMethodService.update(context, "PAYPAL", paymentMethod); }