### Question:
AssetResponse { public static AssetResponse from(Asset asset) { if (asset == null) { throw new NullPointerException("Cannot create model from null asset."); } return new AssetResponse(asset); }  static AssetResponse from(Asset asset);  }### Answer:
@Test public void shouldSucceedFrom() { Asset asset = new Asset(new byte[10], null); AssetResponse resp = AssetResponse.from(asset); assertEquals(asset, resp.getAsset()); }
@Test(expected = NullPointerException.class) public void shouldFailFromNPE() { AssetResponse.from(null); }