// Path: src/main/java/net/nextpulse/jadmin/FormPostEntry.java
// public class FormPostEntry {
//   
//   /**
//    * Key value(s) for this post entry, i.e. the object id, non-editable values.
//    */
//   private LinkedHashMap<String, String> keyValues = new LinkedHashMap<>();
//   /**
//    * Editable values of a resource, i.e. an editable name field.
//    */
//   private LinkedHashMap<String, String> values = new LinkedHashMap<>();
//   
//   public FormPostEntry() {
//   }
//   
//   /**
//    * @return map of unescaped post values
//    */
//   public LinkedHashMap<String, String> getValues() {
//     return values;
//   }
//   
//   public void addValue(String columnName, String value) {
//     values.put(columnName, value);
//   }
//   
//   /**
//    * @return map of unescaped values that make up the identifier of this row
//    */
//   public LinkedHashMap<String, String> getKeyValues() {
//     return keyValues;
//   }
//   
//   /**
//    * Adds a new user supplied value for the specified column.
//    *
//    * @param columnName column name
//    * @param value      user provided value
//    */
//   public void addKeyValue(String columnName, String value) {
//     keyValues.put(columnName, value);
//   }
//   
//   /**
//    * Returns a Map with column keys linked to the submitted values.
//    *
//    * @return this entry as map of column name to value
//    */
//   public Map<String, String> toPropertiesMap() {
//     LinkedHashMap<String, String> output = new LinkedHashMap<>();
//     output.putAll(keyValues);
//     output.putAll(values);
//     return output;
//   }
// }


import net.nextpulse.jadmin.FormPostEntry;
import java.util.*;
import java.util.stream.Collectors;
    return Optional.ofNullable(objects.get(key));
  }
  
  /**
   * Retrieves multiple DatabaseEntry objects from the data store.
   *
   * @param offset        number of objects to skip
   * @param count         number of objects to retrieve
   * @param sortColumn    column to sort by
   * @param sortDirection direction to sort by, true for ascending, false for descending
   * @return list of results
   * @throws DataAccessException if an error occurred while retrieving the objects
   */
  @Override
  public List<DatabaseEntry> selectMultiple(long offset, long count, String sortColumn, boolean sortDirection) throws DataAccessException {
    if(offset >= objects.size()) {
      return Collections.emptyList();
    } else {
      int direction = sortDirection ? 1 : -1;
      return objects.values().stream().sorted((o1, o2) -> genericCompare(o1, o2) * direction).skip(offset).limit(count).collect(Collectors.toList());
    }
  }
  
  /**
   * Inserts a single resourceSchemaProvider instance in to the database, using the unfiltered client submitted data.
   *
   * @param postData unfiltered user submitted data, must be used with caution
   * @throws DataAccessException if an error occurred while inserting the object
   */
  @Override
// Path: src/main/java/net/nextpulse/jadmin/FormPostEntry.java
// public class FormPostEntry {
//   
//   /**
//    * Key value(s) for this post entry, i.e. the object id, non-editable values.
//    */
//   private LinkedHashMap<String, String> keyValues = new LinkedHashMap<>();
//   /**
//    * Editable values of a resource, i.e. an editable name field.
//    */
//   private LinkedHashMap<String, String> values = new LinkedHashMap<>();
//   
//   public FormPostEntry() {
//   }
//   
//   /**
//    * @return map of unescaped post values
//    */
//   public LinkedHashMap<String, String> getValues() {
//     return values;
//   }
//   
//   public void addValue(String columnName, String value) {
//     values.put(columnName, value);
//   }
//   
//   /**
//    * @return map of unescaped values that make up the identifier of this row
//    */
//   public LinkedHashMap<String, String> getKeyValues() {
//     return keyValues;
//   }
//   
//   /**
//    * Adds a new user supplied value for the specified column.
//    *
//    * @param columnName column name
//    * @param value      user provided value
//    */
//   public void addKeyValue(String columnName, String value) {
//     keyValues.put(columnName, value);
//   }
//   
//   /**
//    * Returns a Map with column keys linked to the submitted values.
//    *
//    * @return this entry as map of column name to value
//    */
//   public Map<String, String> toPropertiesMap() {
//     LinkedHashMap<String, String> output = new LinkedHashMap<>();
//     output.putAll(keyValues);
//     output.putAll(values);
//     return output;
//   }
// }


// Path: src/main/java/net/nextpulse/jadmin/dao/InMemoryDAO.java
import net.nextpulse.jadmin.FormPostEntry;
import java.util.*;
import java.util.stream.Collectors;

    return Optional.ofNullable(objects.get(key));
  }
  
  /**
   * Retrieves multiple DatabaseEntry objects from the data store.
   *
   * @param offset        number of objects to skip
   * @param count         number of objects to retrieve
   * @param sortColumn    column to sort by
   * @param sortDirection direction to sort by, true for ascending, false for descending
   * @return list of results
   * @throws DataAccessException if an error occurred while retrieving the objects
   */
  @Override
  public List<DatabaseEntry> selectMultiple(long offset, long count, String sortColumn, boolean sortDirection) throws DataAccessException {
    if(offset >= objects.size()) {
      return Collections.emptyList();
    } else {
      int direction = sortDirection ? 1 : -1;
      return objects.values().stream().sorted((o1, o2) -> genericCompare(o1, o2) * direction).skip(offset).limit(count).collect(Collectors.toList());
    }
  }
  
  /**
   * Inserts a single resourceSchemaProvider instance in to the database, using the unfiltered client submitted data.
   *
   * @param postData unfiltered user submitted data, must be used with caution
   * @throws DataAccessException if an error occurred while inserting the object
   */
  @Override
  public void insert(FormPostEntry postData) throws DataAccessException {