// Path: breakerbox-store/src/main/java/com/yammer/breakerbox/store/model/DependencyModel.java
// public class DependencyModel {
//     private final DependencyId dependencyId;
//     private final DateTime dateTime;
//     private final TenacityConfiguration tenacityConfiguration;
//     private final String user;
//     private final ServiceId serviceId;
// 
//     public DependencyModel(DependencyId dependencyId,
//                            DateTime dateTime,
//                            TenacityConfiguration tenacityConfiguration,
//                            String user,
//                            ServiceId serviceId) {
//         this.dependencyId = dependencyId;
//         this.dateTime = dateTime;
//         this.tenacityConfiguration = tenacityConfiguration;
//         this.user = user;
//         this.serviceId = serviceId;
//     }
// 
//     public DependencyId getDependencyId() {
//         return dependencyId;
//     }
// 
//     public DateTime getDateTime() {
//         return dateTime;
//     }
// 
//     public TenacityConfiguration getTenacityConfiguration() {
//         return tenacityConfiguration;
//     }
// 
//     public String getUser() {
//         return user;
//     }
// 
//     public ServiceId getServiceId() {
//         return serviceId;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(dependencyId, dateTime, tenacityConfiguration, user, serviceId);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final DependencyModel other = (DependencyModel) obj;
//         return Objects.equals(this.dependencyId, other.dependencyId)
//                 && Objects.equals(this.dateTime, other.dateTime)
//                 && Objects.equals(this.tenacityConfiguration, other.tenacityConfiguration)
//                 && Objects.equals(this.user, other.user)
//                 && Objects.equals(this.serviceId, other.serviceId);
//     }
// }
// 
// Path: breakerbox-store/src/main/java/com/yammer/breakerbox/store/model/ServiceModel.java
// public class ServiceModel {
//     private final ServiceId serviceId;
//     private final DependencyId dependencyId;
// 
//     public ServiceModel(ServiceId serviceId, DependencyId dependencyId) {
//         this.serviceId = serviceId;
//         this.dependencyId = dependencyId;
//     }
// 
//     public ServiceId getServiceId() {
//         return serviceId;
//     }
// 
//     public DependencyId getDependencyId() {
//         return dependencyId;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(serviceId, dependencyId);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final ServiceModel other = (ServiceModel) obj;
//         return Objects.equals(this.serviceId, other.serviceId)
//                 && Objects.equals(this.dependencyId, other.dependencyId);
//     }
// }


import com.google.common.collect.ImmutableList;
import com.yammer.breakerbox.store.model.DependencyModel;
import com.yammer.breakerbox.store.model.ServiceModel;
import org.joda.time.DateTime;
import java.util.Collection;
import java.util.Optional;
package com.yammer.breakerbox.azure.model;



public class Entities {
    private Entities() {}

    public static Optional<ServiceModel> toServiceModel(Optional<ServiceEntity> serviceEntity) {
        return serviceEntity.map(Entities::toModel);
    }
    
    public static ServiceModel toModel(ServiceEntity serviceEntity) {
        return new ServiceModel(serviceEntity.getServiceId(), serviceEntity.getDependencyId());
    }

    public static ServiceEntity from(ServiceModel serviceModel) {
        return ServiceEntity.build(serviceModel.getServiceId(), serviceModel.getDependencyId());
    }

// Path: breakerbox-store/src/main/java/com/yammer/breakerbox/store/model/DependencyModel.java
// public class DependencyModel {
//     private final DependencyId dependencyId;
//     private final DateTime dateTime;
//     private final TenacityConfiguration tenacityConfiguration;
//     private final String user;
//     private final ServiceId serviceId;
// 
//     public DependencyModel(DependencyId dependencyId,
//                            DateTime dateTime,
//                            TenacityConfiguration tenacityConfiguration,
//                            String user,
//                            ServiceId serviceId) {
//         this.dependencyId = dependencyId;
//         this.dateTime = dateTime;
//         this.tenacityConfiguration = tenacityConfiguration;
//         this.user = user;
//         this.serviceId = serviceId;
//     }
// 
//     public DependencyId getDependencyId() {
//         return dependencyId;
//     }
// 
//     public DateTime getDateTime() {
//         return dateTime;
//     }
// 
//     public TenacityConfiguration getTenacityConfiguration() {
//         return tenacityConfiguration;
//     }
// 
//     public String getUser() {
//         return user;
//     }
// 
//     public ServiceId getServiceId() {
//         return serviceId;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(dependencyId, dateTime, tenacityConfiguration, user, serviceId);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final DependencyModel other = (DependencyModel) obj;
//         return Objects.equals(this.dependencyId, other.dependencyId)
//                 && Objects.equals(this.dateTime, other.dateTime)
//                 && Objects.equals(this.tenacityConfiguration, other.tenacityConfiguration)
//                 && Objects.equals(this.user, other.user)
//                 && Objects.equals(this.serviceId, other.serviceId);
//     }
// }
// 
// Path: breakerbox-store/src/main/java/com/yammer/breakerbox/store/model/ServiceModel.java
// public class ServiceModel {
//     private final ServiceId serviceId;
//     private final DependencyId dependencyId;
// 
//     public ServiceModel(ServiceId serviceId, DependencyId dependencyId) {
//         this.serviceId = serviceId;
//         this.dependencyId = dependencyId;
//     }
// 
//     public ServiceId getServiceId() {
//         return serviceId;
//     }
// 
//     public DependencyId getDependencyId() {
//         return dependencyId;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(serviceId, dependencyId);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final ServiceModel other = (ServiceModel) obj;
//         return Objects.equals(this.serviceId, other.serviceId)
//                 && Objects.equals(this.dependencyId, other.dependencyId);
//     }
// }


// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/model/Entities.java
import com.google.common.collect.ImmutableList;
import com.yammer.breakerbox.store.model.DependencyModel;
import com.yammer.breakerbox.store.model.ServiceModel;
import org.joda.time.DateTime;
import java.util.Collection;
import java.util.Optional;

package com.yammer.breakerbox.azure.model;



public class Entities {
    private Entities() {}

    public static Optional<ServiceModel> toServiceModel(Optional<ServiceEntity> serviceEntity) {
        return serviceEntity.map(Entities::toModel);
    }
    
    public static ServiceModel toModel(ServiceEntity serviceEntity) {
        return new ServiceModel(serviceEntity.getServiceId(), serviceEntity.getDependencyId());
    }

    public static ServiceEntity from(ServiceModel serviceModel) {
        return ServiceEntity.build(serviceModel.getServiceId(), serviceModel.getDependencyId());
    }

    public static Optional<DependencyModel> toDependencyModel(Optional<DependencyEntity> dependencyEntity) {