### Question:
NotificationLogging implements InvocationHandler { public static String logNotification(INotificationData iNotif) { if (iNotif == null) { return "NULL"; } Class<? extends INotificationData> clazz = iNotif.getClass(); Method[] declaredMethods = clazz.getDeclaredMethods(); if (declaredMethods == null || declaredMethods.length == 0) { return "EMPTY"; } StringBuilder buffer = new StringBuilder("ASDC Notification:"); buffer.append(System.lineSeparator()); for (Method m : declaredMethods) { if ((m != null) && isGetter(m)) { for (String prefix : GETTER_PREFIXES) { if (m.getName().startsWith(prefix)) { buffer.append(m.getName().substring(prefix.length())); break; } } try { buffer.append(testNull(m.invoke(iNotif, (Object[]) null))); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { logger.debug("Exception", e); buffer.append("UNREADABLE"); } buffer.append(System.lineSeparator()); } } return buffer.toString(); } private  NotificationLogging(); static InvocationHandler getHandler(); static String logNotification(INotificationData iNotif); @Override Object invoke(Object proxy, Method method, Object[] args);  }### Answer:
@Test public void logNotificationTest() { notificationData.setDistributionID("distributionID"); notificationData.setServiceVersion("123456"); notificationData.setServiceUUID("serviceUUID"); notificationData.setWorkloadContext("workloadContext"); String response = NotificationLogging.logNotification(notificationData); assertTrue(response.contains("ASDC Notification")); assertTrue(response.contains("ResourcesType not recognized")); assertTrue(response.contains("ServiceNameNULL")); assertTrue(response.contains("ServiceUUIDserviceUUID")); assertTrue(response.contains("ResourcesImplNULL")); assertTrue(response.contains("ServiceArtifactsType not recognized")); assertTrue(response.contains("ServiceDescriptionNULL")); assertTrue(response.contains("DistributionIDdistributionID")); assertTrue(response.contains("ServiceInvariantUUIDNULL")); assertTrue(response.contains("WorkloadContextworkloadContext")); }
@Test public void logNotificationNullTest() { notificationData = null; String response = NotificationLogging.logNotification(notificationData); assertEquals("NULL", response); }