### Question:
JsonUtil { public static Author getNPMAuthor(final File file) throws IOException { final JSONObject obj = readJsconFile(file); final JSONObject authorObject = obj.optJSONObject("author"); if (authorObject != null) { String name = authorObject.optString("name"); String email = authorObject.optString("email"); return new Author(name, email); } return null; } private  JsonUtil(); static ArchiveIdentifierVersion getNPMArchiveDescription(final File file); static String getNPMArchiveLicenseName(final File file); static String getNPMArchiveVendorName(final File file); static Author getNPMAuthor(final File file);  }### Answer:
@Test public void getNPMAuthorTest() throws Exception { File packageFile = getFileFromClasspath("package.json"); Author actual = JsonUtil.getNPMAuthor(packageFile); Assert.assertEquals("Name", actual.getName()); Assert.assertEquals("test@test.com", actual.getEmail()); }
@Test public void getNPMAuthorNullTest() throws Exception { File packageFile = getFileFromClasspath("package-no-license.json"); Author actual = JsonUtil.getNPMAuthor(packageFile); Assert.assertEquals(null, actual); }