ClientDAO { public Optional<Client> getClientByName(String name) { ClientsRecord r = dslContext.fetchOne(CLIENTS, CLIENTS.NAME.eq(name)); return Optional.ofNullable(r).map(clientMapper::map); } private  ClientDAO(DSLContext dslContext, ClientMapper clientMapper,
      RowHmacGenerator rowHmacGenerator); long createClient(String name, String user, String description,
      @Nullable URI spiffeId); void deleteClient(Client client); void sawClient(Client client, @Nullable Principal principal); Optional<Client> getClientByName(String name); Optional<Client> getClientBySpiffeId(URI spiffeId); Optional<Client> getClientById(long id); ImmutableSet<Client> getClients();  }
@Test public void getClientByName() { assertThat(clientDAO.getClientByName("client1")).contains(client1); }
@Test public void getNonExistentClientByName() { assertThat(clientDAO.getClientByName("non-existent")).isEmpty(); }