### Question:
FileStorage { public void store(@NotNull UserIdentifier userId, @NotNull Object entity) throws ServiceException { LOG.debug("Storing file for {}", userId); Path histPath = getPath(userId, entity.getClass()); try (FileChannel channel = openForWrite(histPath)) { String jsonText = jsonMarshaller.marshal(entity); ByteBuffer buf = encoder.get().encode(CharBuffer.wrap(jsonText)); int written = channel.write(buf); channel.truncate(written); } catch (IOException | SecurityException | IllegalStateException e) { throw new ServiceException("Error storing query history in:" + histPath + " - " + e.getClass() + " - " + e.getMessage(), e); } LOG.trace("File has been sotred {}", entity); }  boolean supported(); void store(@NotNull UserIdentifier userId, @NotNull Object entity); @Valid Optional<T> read(@NotNull UserIdentifier userId, @NotNull Class<T> clazz); int getLockRetryCount();  }### Answer:
@Test(expected = BeanValidationException.class) public void testStore_Validation() { storage.store(new UserIdentifier(), null); }
@Test(expected = BeanValidationException.class) public void testStore_Validation_IncorrectUserIdentifier() { storage.store(new UserIdentifier(null), String.class); }