### Question:
EnergyModellerConverter { public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; }  static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample); static eu.ascetic.paas.applicationmanager.model.ApplicationSample convert(ApplicationSample applicationSample); static List<eu.ascetic.paas.applicationmanager.model.EventSample> convertList(List<EventSample> eventSamples); static List<eu.ascetic.paas.applicationmanager.model.ApplicationSample> convertSampleList(List<ApplicationSample> applicationSamples);  }### Answer:
@Test public void convertEnergySampleTest() { EventSample nullEventSample = null; eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = EnergyModellerConverter.convert(nullEventSample); assertEquals(null, newEventSample); EventSample eventSample = new EventSample(); eventSample.setCvalue(1.0); eventSample.setEvalue(2.0); eventSample.setPvalue(3.0); eventSample.setTimestampBeging(1l); eventSample.setTimestampEnd(2l); eventSample.setVmid("vmid"); eventSample.setAppid("appid"); newEventSample = EnergyModellerConverter.convert(eventSample); assertEquals("vmid", newEventSample.getVmid()); assertEquals(1.0, newEventSample.getCvalue(), 0.00001); assertEquals(2.0, newEventSample.getEvalue(), 0.00001); assertEquals(3.0, newEventSample.getPvalue(), 0.00001); assertEquals(1l, newEventSample.getTimestampBeging()); assertEquals(2l, newEventSample.getTimestampEnd()); assertEquals("appid", newEventSample.getAppid()); }
@Test public void convertSampleTest() { ApplicationSample nullApplicationSample = null; eu.ascetic.paas.applicationmanager.model.ApplicationSample newApplicationSample = EnergyModellerConverter.convert(nullApplicationSample); assertEquals(null, newApplicationSample); ApplicationSample applicationSample = new ApplicationSample(); applicationSample.setAppid("appid"); applicationSample.setC_value(1.0); applicationSample.setE_value(2.0); applicationSample.setOrderID(5); applicationSample.setP_value(3.0); applicationSample.setTime(2l); applicationSample.setVmid("vmid"); newApplicationSample = EnergyModellerConverter.convert(applicationSample); assertEquals("appid", newApplicationSample.getAppid()); assertEquals(1.0, newApplicationSample.getcValue(), 0.0001); assertEquals(2.0, newApplicationSample.geteValue(), 0.0001); assertEquals(5, newApplicationSample.getOrderID()); assertEquals(3.0, newApplicationSample.getpValue(), 0.0001); assertEquals(2l, newApplicationSample.getTime()); assertEquals("vmid", newApplicationSample.getVmid()); }