### Question:
JpaStorage implements Storage { @Override public RelatedObservation getRelatedObservation(int id) { return (RelatedObservation) getObservation(id); } JpaStorage(PersistenceManager persistenceManager); @Override DataFile getDatafile(int id); @Override final DataFile getDatafile(final String path); @Override DataFile getDatafileWithTransaction(String path); void store(DataFile dataFile); @Override int storeWithTransaction(DataFile dataFile); @Override Observation getObservation(int id); @Override RelatedObservation getRelatedObservation(int id); @Override ReferenceObservation getReferenceObservation(int id); @Override final Sensor getSensor(final String sensorName); @Override Sensor getSensorWithTransaction(String sensorName); @Override void storeWithTransaction(Sensor sensor); @Override List<RelatedObservation> getRelatedObservations(String sensorName, Date startDate, Date stopDate); @Override void store(InsituObservation insituObservation);  }### Answer:
@Test public void testGetRelatedObservation() { final int id = 98843; final String name = "related"; final RelatedObservation observation = new RelatedObservation(); observation.setName(name); when(persistenceManager.pick(GET_OBSERVATION_SQL, id)).thenReturn(observation); final RelatedObservation toolStorageObservation = jpaStorage.getRelatedObservation(id); assertNotNull(toolStorageObservation); assertEquals(name, toolStorageObservation.getName()); verify(persistenceManager, times(1)).pick(GET_OBSERVATION_SQL, id); verifyNoMoreInteractions(persistenceManager); }