Set<String> cookbookNames = api.listCookbooks();
assertFalse(cookbookNames.isEmpty());
for (String cookbook : cookbookNames) {
for (String version : api.getVersionsOfCookbook(cookbook)) {
CookbookVersion cookbookO = api.getCookbook(cookbook, version);
for (Resource resource : ImmutableList.<Resource> builder().addAll(cookbookO.getDefinitions())
.addAll(cookbookO.getFiles()).addAll(cookbookO.getLibraries()).addAll(cookbookO.getSuppliers())
.addAll(cookbookO.getRecipes()).addAll(cookbookO.getResources()).addAll(cookbookO.getRootFiles())
.addAll(cookbookO.getTemplates()).build()) {
try {
InputStream stream = api.getResourceContents(resource);
byte[] md5 = asByteSource(stream).hash(md5()).asBytes();
assertEquals(md5, resource.getChecksum());
} catch (NullPointerException e) {